Bug 46921 - gdm72xx/gdm_sdio.c:683: bad pointer test
Summary: gdm72xx/gdm_sdio.c:683: bad pointer test
Status: RESOLVED CODE_FIX
Alias: None
Product: Drivers
Classification: Unclassified
Component: Staging (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Alan
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-02 16:47 UTC by David Binderman
Modified: 2012-10-23 18:31 UTC (History)
2 users (show)

See Also:
Kernel Version: 3.6-rc4
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description David Binderman 2012-09-02 16:47:14 UTC
I just ran the static analyser cppcheck over the source code of the
linux kernel version 3.6-rc4.

It said

[linux-3.6-rc4/drivers/staging/gdm72xx/gdm_sdio.c:683]: (style) A pointer can not be negative so it is either pointless or an error to check if it is.

The source code is

    ret = init_sdio(sdev);
    if (sdev < 0)
        goto out;


Suggest new code

    ret = init_sdio(sdev);
    if (ret < 0)
        goto out;
Comment 1 Greg Kroah-Hartman 2012-09-02 23:32:10 UTC
On Sun, Sep 02, 2012 at 04:47:14PM +0000, bugzilla-daemon@bugzilla.kernel.org wrote:
> https://bugzilla.kernel.org/show_bug.cgi?id=46921
> 
>            Summary: gdm72xx/gdm_sdio.c:683: bad pointer test

Please post patches or this info to the mailing list.

greg k-h
Comment 2 Alan 2012-09-03 15:43:04 UTC
Patch queued
Comment 3 Florian Mickler 2012-10-15 21:22:42 UTC
A patch referencing this bug report has been merged in Linux v3.7-rc1:

commit f1efd9fe08a9ada843cd99f949a130555df045bd
Author: Alan Cox <alan@linux.intel.com>
Date:   Tue Sep 4 16:04:36 2012 +0100

    staging: gdm72xx: Fix bogus test

Note You need to log in before you can comment on or make changes to this bug.