The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Matthew Dharm <mdharm-kernel@one-eyed-alien.net>
To: Adrian Bunk <bunk@stusta.de>
Cc: gregkh@suse.de, linux-usb-devel@lists.sourceforge.net,
	usb-storage@lists.one-eyed-alien.net,
	linux-kernel@vger.kernel.org
Subject: Re: [2.6 patch] usbat_check_status(): fix check-after-use
Date: Mon, 30 Jul 2007 17:13:47 -0700	[thread overview]
Message-ID: <20070731001347.GA14124@one-eyed-alien.net> (raw)
In-Reply-To: <20070730222822.GG3972@stusta.de>

[-- Attachment #1: Type: text/plain, Size: 1053 bytes --]

Signed-off-by: Matthew Dharm <mdharm-usb@one-eyed-alien.net>

On Tue, Jul 31, 2007 at 12:28:22AM +0200, Adrian Bunk wrote:
> The Coverity checker spotted that we have already oops'ed if "us"
> was NULL.
> 
> Since "us" can't be NULL in the only caller this patch removes the
> NULL check.
> 
> Signed-off-by: Adrian Bunk <bunk@stusta.de>
> 
> ---
> --- linux-2.6.23-rc1-mm1/drivers/usb/storage/shuttle_usbat.c.old	2007-07-30 16:56:34.000000000 +0200
> +++ linux-2.6.23-rc1-mm1/drivers/usb/storage/shuttle_usbat.c	2007-07-30 16:57:24.000000000 +0200
> @@ -190,9 +190,6 @@ static int usbat_check_status(struct us_
>  	unsigned char *reply = us->iobuf;
>  	int rc;
>  
> -	if (!us)
> -		return USB_STOR_TRANSPORT_ERROR;
> -
>  	rc = usbat_get_status(us, reply);
>  	if (rc != USB_STOR_XFER_GOOD)
>  		return USB_STOR_TRANSPORT_FAILED;

-- 
Matthew Dharm                              Home: mdharm-usb@one-eyed-alien.net 
Maintainer, Linux USB Mass Storage Driver

I need a computer?
					-- Customer
User Friendly, 2/19/1998

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

      reply	other threads:[~2007-07-31  0:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-30 22:28 [2.6 patch] usbat_check_status(): fix check-after-use Adrian Bunk
2007-07-31  0:13 ` Matthew Dharm [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070731001347.GA14124@one-eyed-alien.net \
    --to=mdharm-kernel@one-eyed-alien.net \
    --cc=bunk@stusta.de \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb-devel@lists.sourceforge.net \
    --cc=usb-storage@lists.one-eyed-alien.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox