Bug 44081

Summary: ov9640.c:605: possible missing break
Product: Drivers Reporter: David Binderman (dcb314)
Component: Video(Other)Assignee: Alan (alan)
Status: RESOLVED CODE_FIX    
Severity: normal CC: alan, florian
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 3.5-rc5 Subsystem:
Regression: No Bisected commit-id:

Description David Binderman 2012-07-01 14:55:11 UTC
I just ran the static analyser cppcheck over the source code of the
linux kernel version 3.5-rc5.

It said

[linux-3.5-rc5/drivers/media/video/ov9640.c:605]: (warning) Redundant assignment of "devname" in switch

The source code is

    switch (VERSION(pid, ver)) {
    case OV9640_V2:
        devname     = "ov9640";
        priv->model = V4L2_IDENT_OV9640;
        priv->revision  = 2;
    case OV9640_V3:
        devname     = "ov9640";
        priv->model = V4L2_IDENT_OV9640;
        priv->revision  = 3;
        break;
    default:
        dev_err(&client->dev, "Product ID error %x:%x\n", pid, ver);
        return -ENODEV;
    }

It looks to me like a missing break on the _V2 case.
Comment 1 Alan 2012-07-02 12:36:20 UTC
Patch queued
Comment 2 Florian Mickler 2012-08-04 19:09:15 UTC
A patch referencing this bug report has been merged in Linux v3.6-rc1:

commit 908d4d141f9608d1966ea8b483ee1c1aad04e438
Author: Alan Cox <alan@linux.intel.com>
Date:   Tue Jul 24 11:50:49 2012 -0300

    [media] ov9640: fix missing break