Linux Media Controller development
 help / color / mirror / Atom feed
From: Jia-Ju Bai <baijiaju1990@gmail.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: linux-media@vger.kernel.org,
	Mauro Carvalho Chehab <mchehab+huawei@kernel.org>,
	hverkuil-cisco@xs4all.nl
Subject: Re: [bug report] media: tuners: fix error return code of hybrid_tuner_request_state()
Date: Thu, 13 May 2021 10:20:08 +0800	[thread overview]
Message-ID: <ec6ac4ef-057f-22a2-f2be-1773b2c50c8e@gmail.com> (raw)
In-Reply-To: <20210512141612.GA1922@kadam>

Hi Dan,

Thanks for your report.
I check the code again, and find that returning zero should indicate an 
error here.
Good catch of Smatch :)

Sorry for my mistake in my patch...
Please revert the incorrect change caused by my patch b9302fa7ed97.

CC to Mauro Carvalho Chehab and Hans Verkuil.


Best wishes,
Jia-Ju Bai


On 2021/5/12 22:16, Dan Carpenter wrote:
> On Wed, May 12, 2021 at 05:03:26PM +0300, Dan Carpenter wrote:
>> Hello Jia-Ju Bai,
>>
>> The patch b9302fa7ed97: "media: tuners: fix error return code of
>> hybrid_tuner_request_state()" from Mar 6, 2021, leads to the
>> following static checker warnings:
>>
>> drivers/media/tuners/tuner-simple.c:1112 simple_tuner_attach() error: potential null dereference 'priv'.  (<unknown> returns null)
>> drivers/media/tuners/mxl5007t.c:885 mxl5007t_attach() error: potential null dereference 'state'.  (<unknown> returns null)
>> drivers/media/tuners/tda18271-fe.c:1311 tda18271_attach() error: potential null dereference 'priv'.  (<unknown> returns null)
>> drivers/media/tuners/xc4000.c:1685 xc4000_attach() error: potential null dereference 'priv'.  (<unknown> returns null)
>> drivers/media/tuners/xc4000.c:1699 xc4000_attach() error: potential null dereference 'priv'.  (<unknown> returns null)
>> drivers/media/tuners/xc5000.c:1397 xc5000_attach() error: potential null dereference 'priv'.  (<unknown> returns null)
>> drivers/media/tuners/r820t.c:2350 r820t_attach() error: potential null dereference 'priv'.  (<unknown> returns null)
>> drivers/media/tuners/tuner-xc2028.c:1500 xc2028_attach() error: potential null dereference 'priv'.  (<unknown> returns null)
>>
>> drivers/media/tuners/tuner-i2c.h
>>     109  /* The return value of hybrid_tuner_request_state indicates the number of
>>     110   * instances using this tuner object.
>>     111   *
>>     112   * 0 - no instances, indicates an error - kzalloc must have failed
>>
>> The comment says that hybrid_tuner_request_state() returns an error.
> I meant returns zero on error.


  reply	other threads:[~2021-05-13  2:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-12 14:03 [bug report] media: tuners: fix error return code of hybrid_tuner_request_state() Dan Carpenter
2021-05-12 14:16 ` Dan Carpenter
2021-05-13  2:20   ` Jia-Ju Bai [this message]
2021-05-13  7:29     ` Dan Carpenter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ec6ac4ef-057f-22a2-f2be-1773b2c50c8e@gmail.com \
    --to=baijiaju1990@gmail.com \
    --cc=dan.carpenter@oracle.com \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab+huawei@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox