Skip to content

Commit

Permalink
media: em28xx: Don't use ops->resume if NULL
Browse files Browse the repository at this point in the history
Changeset  be7fd3c ("media: em28xx: Hauppauge DualHD
second tuner functionality") introduced a potential NULL pointer
dereference, as pointed by Coverity:

CID 1434731 (#1 of 1): Dereference after null check (FORWARD_NULL)16. var_deref_op: Dereferencing null pointer ops->resume.

var_compare_op: Comparing ops->resume to null implies that ops->resume might be null.
1174                if (ops->resume)
1175                        ops->resume(dev);
1176                if (dev->dev_next)
1177                        ops->resume(dev->dev_next);

Fixes: be7fd3c ("media: em28xx: Hauppauge DualHD second tuner functionality")

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
  • Loading branch information
Mauro Carvalho Chehab authored and Mauro Carvalho Chehab committed May 4, 2018
1 parent de6dddf commit fd901b6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/media/usb/em28xx/em28xx-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1171,8 +1171,9 @@ int em28xx_resume_extension(struct em28xx *dev)
dev_info(&dev->intf->dev, "Resuming extensions\n");
mutex_lock(&em28xx_devlist_mutex);
list_for_each_entry(ops, &em28xx_extension_devlist, next) {
if (ops->resume)
ops->resume(dev);
if (!ops->resume)
continue;
ops->resume(dev);
if (dev->dev_next)
ops->resume(dev->dev_next);
}
Expand Down

0 comments on commit fd901b6

Please sign in to comment.