diff --git a/drivers/staging/most/aim-cdev/cdev.c b/drivers/staging/most/aim-cdev/cdev.c index cfc32dff6512..252a17cf153c 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; }