[SCSI] libosd: Fix unchecked err return found by smatch
authorBoaz Harrosh <bharrosh@panasas.com>
Fri, 19 Feb 2010 19:46:24 +0000 (11:46 -0800)
committerJames Bottomley <James.Bottomley@suse.de>
Wed, 3 Mar 2010 15:42:21 +0000 (21:12 +0530)
Doing CHECK="smatch --two-passes gives:
drivers/scsi/osd/osd_initiator.c +1435 osd_finalize_request warning: assignment to 'ret' was never used

Which is an unchecked possible allocation failure, Fixed.

Reported-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
drivers/scsi/osd/osd_initiator.c

index 24223473f573c9b9e3ffd51714e015a68f8fa0cb..60de8509150228a5bd09210b54420b2cefa91ecf 100644 (file)
@@ -1433,6 +1433,10 @@ int osd_finalize_request(struct osd_request *or,
        cdbh->command_specific_options |= or->attributes_mode;
        if (or->attributes_mode == OSD_CDB_GET_ATTR_PAGE_SET_ONE) {
                ret = _osd_req_finalize_attr_page(or);
+               if (ret) {
+                       OSD_DEBUG("_osd_req_finalize_attr_page failed\n");
+                       return ret;
+               }
        } else {
                /* TODO: I think that for the GET_ATTR command these 2 should
                 * be reversed to keep them in execution order (for embeded