Skip to content

Commit

Permalink
media: allegro: fix an error pointer vs NULL check
Browse files Browse the repository at this point in the history
The allegro_mbox_init() function returns error pointers, it never
returns NULL.

Fixes: 94dc765 ("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]>
  • Loading branch information
Dan Carpenter authored and sigmaris committed Aug 8, 2020
1 parent cc21bdb commit 0221104
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/staging/media/allegro-dvt/allegro-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 0221104

Please sign in to comment.