]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
media: em28xx: Don't use ops->suspend if it is NULL
authorColin Ian King <colin.king@canonical.com>
Fri, 17 Sep 2021 16:07:02 +0000 (18:07 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 26 Nov 2021 10:36:08 +0000 (11:36 +0100)
commite8bde27b97a345878c2a3d6446373601a7260705
tree36c81c9494546d2eec7a31e0ed48f95847716cb3
parent22d44652b6d6404b96a40bb051d1046e6c005ae5
media: em28xx: Don't use ops->suspend if it is NULL

[ Upstream commit 51fa3b70d27342baf1ea8aaab3e96e5f4f26d5b2 ]

The call to ops->suspend for the dev->dev_next case can currently
trigger a call on a null function pointer if ops->suspend is null.
Skip over the use of function ops->suspend if it is null.

Addresses-Coverity: ("Dereference after null check")

Fixes: be7fd3c3a8c5 ("media: em28xx: Hauppauge DualHD second tuner functionality")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/usb/em28xx/em28xx-core.c