vserver 2.0 rc7
[linux-2.6.git] / drivers / usb / storage / sddr55.c
index 10270f4..8451779 100644 (file)
@@ -31,9 +31,9 @@
 #include <scsi/scsi.h>
 #include <scsi/scsi_cmnd.h>
 
+#include "usb.h"
 #include "transport.h"
 #include "protocol.h"
-#include "usb.h"
 #include "debug.h"
 #include "sddr55.h"
 
@@ -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);
 }