From: Christian Gromm Date: Tue, 28 Jul 2015 15:16:11 +0000 (+0200) Subject: Staging: most: fix passing a potential null pointer X-Git-Tag: v4.14-rc1~4839^2~359 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a11442fe87d63994816cf2edde4450410df397af;p=platform%2Fkernel%2Flinux-rpi.git Staging: most: fix passing a potential null pointer This patch fixes passing of a potential null pointer. Reported-by: Dan Carpenter Signed-off-by: Christian Gromm Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/most/aim-cdev/cdev.c b/drivers/staging/most/aim-cdev/cdev.c index cfc32df..252a17c 100644 --- a/drivers/staging/most/aim-cdev/cdev.c +++ b/drivers/staging/most/aim-cdev/cdev.c @@ -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; }