mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2025-01-20 04:44:26 +08:00
media: au0828: fix a NULL vs IS_ERR() check
The media_device_usb_allocate() function returns error pointers when
it's enabled and something goes wrong. It can return NULL as well, but
only if CONFIG_MEDIA_CONTROLLER is disabled so that doesn't apply here.
Fixes: 812658d88d
("media: change au0828 to use Media Device Allocator API")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
This commit is contained in:
parent
1fcbeeb506
commit
8f2e452730
@ -199,8 +199,8 @@ static int au0828_media_device_init(struct au0828_dev *dev,
|
||||
struct media_device *mdev;
|
||||
|
||||
mdev = media_device_usb_allocate(udev, KBUILD_MODNAME, THIS_MODULE);
|
||||
if (!mdev)
|
||||
return -ENOMEM;
|
||||
if (IS_ERR(mdev))
|
||||
return PTR_ERR(mdev);
|
||||
|
||||
dev->media_dev = mdev;
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user