aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Carpenter <[email protected]>2020-07-22 14:38:48 +0200
committerMauro Carvalho Chehab <[email protected]>2020-08-06 11:27:25 +0200
commit9bde425e70b6d6b49f3206a1d3817bccb92a893d (patch)
treef9672ec4b96195371d322d814d0d64962e834d47
parent43663dc4f4300e6a4ff4dade9a17cef42e79232c (diff)
media: allegro: fix an error pointer vs NULL check
The allegro_mbox_init() function returns error pointers, it never returns NULL. Fixes: 94dc76560261 ("media: allegro: rework mbox handling") Signed-off-by: Dan Carpenter <[email protected]> Reviewed-by: Michael Tretter <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
-rw-r--r--drivers/staging/media/allegro-dvt/allegro-core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/media/allegro-dvt/allegro-core.c b/drivers/staging/media/allegro-dvt/allegro-core.c
index 61beae1fca36..9f718f43282b 100644
--- a/drivers/staging/media/allegro-dvt/allegro-core.c
+++ b/drivers/staging/media/allegro-dvt/allegro-core.c
@@ -2952,7 +2952,7 @@ static int allegro_mcu_hw_init(struct allegro_dev *dev,
info->mailbox_size);
dev->mbox_status = allegro_mbox_init(dev, info->mailbox_status,
info->mailbox_size);
- if (!dev->mbox_command || !dev->mbox_status) {
+ if (IS_ERR(dev->mbox_command) || IS_ERR(dev->mbox_status)) {
v4l2_err(&dev->v4l2_dev,
"failed to initialize mailboxes\n");
return -EIO;