[media] dib7000p: return error code on allocation failure
authorDan Carpenter <error27@gmail.com>
Sat, 6 Aug 2011 08:00:34 +0000 (05:00 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sat, 3 Sep 2011 16:03:52 +0000 (13:03 -0300)
The goto needs to be moved after the assignment.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/dvb/frontends/dib7000p.c

index 4eb9c2b49cd566e3d835738dce705819370b3bec..ce8534ff142efe448de4cf2b7f325edc74fadaab 100644 (file)
@@ -1598,8 +1598,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;