All of lore.kernel.org
 help / color / mirror / Atom feed
* [2.6 patch] usbat_check_status(): fix check-after-use
@ 2007-07-30 22:28 Adrian Bunk
  2007-07-31  0:13 ` Matthew Dharm
  0 siblings, 1 reply; 2+ messages in thread
From: Adrian Bunk @ 2007-07-30 22:28 UTC (permalink / raw)
  To: mdharm-usb, gregkh; +Cc: linux-usb-devel, usb-storage, linux-kernel

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;


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [2.6 patch] usbat_check_status(): fix check-after-use
  2007-07-30 22:28 [2.6 patch] usbat_check_status(): fix check-after-use Adrian Bunk
@ 2007-07-31  0:13 ` Matthew Dharm
  0 siblings, 0 replies; 2+ messages in thread
From: Matthew Dharm @ 2007-07-31  0:13 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: gregkh, linux-usb-devel, usb-storage, linux-kernel

[-- 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 --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-07-31  0:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.