Skip to contentSkip to conversation

libosd: Fix unchecked err return found by smatch

PATCH RESEND New Boaz Harrosh 1 participant 1 message Feb 19, 2010 SCSI

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 libosd: Fix unchecked err return found by smatch

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.

---
 drivers/scsi/osd/osd_initiator.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
drivers/scsi/osd/osd_initiator.c +4 -0
index 2422347..60de850 100644
@@ -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
Signature · 1 line
1.6.6