Browse Source

Staging: most: fix passing a potential null pointer

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>
Christian Gromm 10 years ago
parent
commit
a11442fe87
1 changed files with 2 additions and 1 deletions
  1. 2 1
      drivers/staging/most/aim-cdev/cdev.c

+ 2 - 1
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;
 }