usb: storage: return on error to avoid a null pointer dereference
[pandora-kernel.git] / drivers / usb / storage / isd200.c
index ffc4193..36f18b5 100644 (file)
@@ -1522,8 +1522,11 @@ static void isd200_ata_command(struct scsi_cmnd *srb, struct us_data *us)
 
        /* Make sure driver was initialized */
 
-       if (us->extra == NULL)
+       if (us->extra == NULL) {
                US_DEBUGP("ERROR Driver not initialized\n");
+               srb->result = DID_ERROR << 16;
+               return;
+       }
 
        scsi_set_resid(srb, 0);
        /* scsi_bufflen might change in protocol translation to ata */