Re: [PATCH] media: allegro: fix an error pointer vs NULL check

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 22 Jul 2020 15:38:48 +0300, Dan Carpenter wrote:
> The allegro_mbox_init() function returns error pointers, it never
> returns NULL.
> 
> Fixes: 94dc76560261 ("media: allegro: rework mbox handling")
> Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>

Reviewed-by: Michael Tretter <m.tretter@xxxxxxxxxxxxxx>

> ---
>  drivers/staging/media/allegro-dvt/allegro-core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> 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;
> -- 
> 2.27.0
> 
> 
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux