media: allegro: fix an error pointer vs NULL check

The allegro_mbox_init() function returns error pointers, it never
returns NULL.

Fixes: 94dc765602 ("media: allegro: rework mbox handling")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Michael Tretter <m.tretter@pengutronix.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
This commit is contained in:
Dan Carpenter 2020-07-22 14:38:48 +02:00 committed by Mauro Carvalho Chehab
parent 43663dc4f4
commit 9bde425e70

View File

@ -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;