[2.6 patch] USB iowarrior.c: fix check-after-use - Kernel

This is a discussion on [2.6 patch] USB iowarrior.c: fix check-after-use - Kernel ; The Coverity checker spotted that we have already oops'ed if "dev" was NULL. Since "dev" being NULL doesn't seem to be possible here this patch removes the NULL check. Signed-off-by: Adrian Bunk --- 82a9906788e8bedc6d5adc54046e1713e4a399df diff --git a/drivers/usb/misc/iowarrior.c b/drivers/usb/misc/iowarrior.c index 46d9f27..9930b0a ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: [2.6 patch] USB iowarrior.c: fix check-after-use

  1. [2.6 patch] USB iowarrior.c: fix check-after-use

    The Coverity checker spotted that we have already oops'ed if "dev"
    was NULL.

    Since "dev" being NULL doesn't seem to be possible here this patch
    removes the NULL check.

    Signed-off-by: Adrian Bunk

    ---
    82a9906788e8bedc6d5adc54046e1713e4a399df
    diff --git a/drivers/usb/misc/iowarrior.c b/drivers/usb/misc/iowarrior.c
    index 46d9f27..9930b0a 100644
    --- a/drivers/usb/misc/iowarrior.c
    +++ b/drivers/usb/misc/iowarrior.c
    @@ -351,7 +351,7 @@ static ssize_t iowarrior_write(struct file *file,

    mutex_lock(&dev->mutex);
    /* verify that the device wasn't unplugged */
    - if (dev == NULL || !dev->present) {
    + if (!dev->present) {
    retval = -ENODEV;
    goto exit;
    }
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  2. Re: [linux-usb-devel] [2.6 patch] USB iowarrior.c: fix check-after-use

    Am Donnerstag 18 Oktober 2007 schrieb Adrian Bunk:
    > The Coverity checker spotted that we have already oops'ed if "dev"
    > was NULL.
    >
    > Since "dev" being NULL doesn't seem to be possible here this patch
    > removes the NULL check.


    Looking good.

    Regards
    Oliver

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

+ Reply to Thread