media: tuners: fix error return code of hybrid_tuner_request_state()
authorJia-Ju Bai <baijiaju1990@gmail.com>
Sat, 6 Mar 2021 14:30:28 +0000 (15:30 +0100)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Mon, 22 Mar 2021 09:21:03 +0000 (10:21 +0100)
commitb9302fa7ed979e84b454e4ca92192cf485a4ed41
treeb660f692970ee950c46ff1ece60c7bf2e481cf5e
parentf3d384e36630e2a552d874e422835606d9cf230a
media: tuners: fix error return code of hybrid_tuner_request_state()

When kzalloc() fails and state is NULL, no error return code is
assigned.
To fix this bug, __ret is assigned with -ENOMEM in this case.

Reported-by: TOTE Robot <oslab@tsinghua.edu.cn>
Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/tuners/tuner-i2c.h