Skip to contentSkip to conversation

csiostor: fix an error code in csio_hw_init()

PATCH In review Dan Carpenter 2 participants 2 messages Apr 14, 2015 – Apr 16, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 csiostor: fix an error code in csio_hw_init()

We should return -ENOMEM if kzalloc() fails here instead of returning success.

drivers/scsi/csiostor/csio_hw.c +1 -0
index 2e66f34..622bdab 100644
@@ -3928,6 +3928,7 @@ csio_hw_init(struct csio_hw *hw)
 
 		evt_entry = kzalloc(sizeof(struct csio_evt_msg), GFP_KERNEL);
 		if (!evt_entry) {
+			rv = -ENOMEM;
 			csio_err(hw, "Failed to initialize eventq");
 			goto err_evtq_cleanup;
 		}
Reviewed-by on v1 1/1
#1 lore raw
Quoted 18 lines · Dan Carpenter

We should return -ENOMEM if kzalloc() fails here instead of returning success.

drivers/scsi/csiostor/csio_hw.c +1 -1
index 2e66f34..622bdab 100644
@@ -3928,6 +3928,7 @@ csio_hw_init(struct csio_hw *hw)
 
 		evt_entry = kzalloc(sizeof(struct csio_evt_msg), GFP_KERNEL);
 		if (!evt_entry) {
+			rv = -ENOMEM;
 			csio_err(hw, "Failed to initialize eventq");
 			goto err_evtq_cleanup;
 		}
--
Quoted 3 lines

To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Tomas