summaryrefslogtreecommitdiffstats
path: root/drivers/usb/storage/sddr55.c
diff options
context:
space:
mode:
authorJesper Juhl <juhl-lkml@dif.dk>2005-04-19 02:39:34 +0200
committerGreg K-H <gregkh@suse.de>2005-04-19 02:39:34 +0200
commit1bc3c9e1e44c2059fe2ffa6ff70ad0a925d7b05f (patch)
tree0bc14ec53acf3b4c08a9995c7ea335e236435558 /drivers/usb/storage/sddr55.c
parent[PATCH] usb: kfree() cleanups in drivers/usb/core/devio.c (diff)
downloadlinux-1bc3c9e1e44c2059fe2ffa6ff70ad0a925d7b05f.tar.xz
linux-1bc3c9e1e44c2059fe2ffa6ff70ad0a925d7b05f.zip
[PATCH] USB: kfree cleanup for drivers/usb/* - no need to check for NULL
Get rid of a bunch of redundant NULL pointer checks in drivers/usb/*, there's no need to check a pointer for NULL before calling kfree() on it. Signed-off-by: Jesper Juhl <juhl-lkml@dif.dk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Index: gregkh-2.6/drivers/usb/class/audio.c ===================================================================
Diffstat (limited to 'drivers/usb/storage/sddr55.c')
-rw-r--r--drivers/usb/storage/sddr55.c24
1 files changed, 8 insertions, 16 deletions
diff --git a/drivers/usb/storage/sddr55.c b/drivers/usb/storage/sddr55.c
index 229ca181716b..8451779f4269 100644
--- a/drivers/usb/storage/sddr55.c
+++ b/drivers/usb/storage/sddr55.c
@@ -119,10 +119,8 @@ static int sddr55_status(struct us_data *us)
/* expect to get short transfer if no card fitted */
if (result == USB_STOR_XFER_SHORT || result == USB_STOR_XFER_STALLED) {
/* had a short transfer, no card inserted, free map memory */
- if (info->lba_to_pba)
- kfree(info->lba_to_pba);
- if (info->pba_to_lba)
- kfree(info->pba_to_lba);
+ kfree(info->lba_to_pba);
+ kfree(info->pba_to_lba);
info->lba_to_pba = NULL;
info->pba_to_lba = NULL;
@@ -649,18 +647,14 @@ static int sddr55_read_map(struct us_data *us) {
return -1;
}
- if (info->lba_to_pba)
- kfree(info->lba_to_pba);
- if (info->pba_to_lba)
- kfree(info->pba_to_lba);
+ kfree(info->lba_to_pba);
+ kfree(info->pba_to_lba);
info->lba_to_pba = kmalloc(numblocks*sizeof(int), GFP_NOIO);
info->pba_to_lba = kmalloc(numblocks*sizeof(int), GFP_NOIO);
if (info->lba_to_pba == NULL || info->pba_to_lba == NULL) {
- if (info->lba_to_pba != NULL)
- kfree(info->lba_to_pba);
- if (info->pba_to_lba != NULL)
- kfree(info->pba_to_lba);
+ kfree(info->lba_to_pba);
+ kfree(info->pba_to_lba);
info->lba_to_pba = NULL;
info->pba_to_lba = NULL;
kfree(buffer);
@@ -728,10 +722,8 @@ static void sddr55_card_info_destructor(void *extra) {
if (!extra)
return;
- if (info->lba_to_pba)
- kfree(info->lba_to_pba);
- if (info->pba_to_lba)
- kfree(info->pba_to_lba);
+ kfree(info->lba_to_pba);
+ kfree(info->pba_to_lba);
}