Skip to contentSkip to conversation

dib7000p: return error code on allocation failure

PATCH New Dan Carpenter 1 participant 1 message Aug 6, 2011

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

PATCH 1/1 dib7000p: return error code on allocation failure

The goto needs to be moved after the assignment.

drivers/media/dvb/frontends/dib7000p.c +1 -1
index a64a538..9c40267 100644
@@ -1577,8 +1577,8 @@ int dib7000pc_detection(struct i2c_adapter *i2c_adap)
 		return -ENOMEM;
 	rx = kzalloc(2*sizeof(u8), GFP_KERNEL);
 	if (!rx) {
-		goto rx_memory_error;
 		ret = -ENOMEM;
+		goto rx_memory_error;
 	}
 
 	msg[0].buf = tx;