summaryrefslogtreecommitdiff
path: root/drivers/media/usb/au0828
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2021-05-14 17:20:38 +0300
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2021-06-02 14:30:28 +0300
commit8f2e452730d2bcd59fe05246f0e19a4c52e0012d (patch)
tree6db5644252aad8e2f7572d893056bf4e2f077b7c /drivers/media/usb/au0828
parent1fcbeeb506fd785025a37d1a874108756abbef6b (diff)
downloadlinux-8f2e452730d2bcd59fe05246f0e19a4c52e0012d.tar.xz
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: 812658d88d26 ("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>
Diffstat (limited to 'drivers/media/usb/au0828')
-rw-r--r--drivers/media/usb/au0828/au0828-core.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/usb/au0828/au0828-core.c b/drivers/media/usb/au0828/au0828-core.c
index a8a72d5fbd12..caefac07af92 100644
--- a/drivers/media/usb/au0828/au0828-core.c
+++ b/drivers/media/usb/au0828/au0828-core.c
@@ -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