Skip to content

Commit 9bde425

Browse files
Dan Carpentermchehab
authored andcommitted
media: allegro: fix an error pointer vs NULL check
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]>
1 parent 43663dc commit 9bde425

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/staging/media/allegro-dvt/allegro-core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2952,7 +2952,7 @@ static int allegro_mcu_hw_init(struct allegro_dev *dev,
29522952
info->mailbox_size);
29532953
dev->mbox_status = allegro_mbox_init(dev, info->mailbox_status,
29542954
info->mailbox_size);
2955-
if (!dev->mbox_command || !dev->mbox_status) {
2955+
if (IS_ERR(dev->mbox_command) || IS_ERR(dev->mbox_status)) {
29562956
v4l2_err(&dev->v4l2_dev,
29572957
"failed to initialize mailboxes\n");
29582958
return -EIO;

0 commit comments

Comments
 (0)