Staging: most: fix passing a potential null pointer
authorChristian Gromm <christian.gromm@microchip.com>
Tue, 28 Jul 2015 15:16:11 +0000 (17:16 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Jul 2015 20:43:15 +0000 (13:43 -0700)
This patch fixes passing of a potential null pointer.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/most/aim-cdev/cdev.c

index cfc32dff651277fe01e9a615e8ade33de8718614..252a17cf153cf1e3b3e3d9010d93d8a73ed5923d 100644 (file)
@@ -204,7 +204,8 @@ static ssize_t aim_write(struct file *filp, const char __user *buf,
        }
        return actual_len - retval;
 error:
-       most_put_mbo(mbo);
+       if (mbo)
+               most_put_mbo(mbo);
        return err;
 }