Linux Media Controller development
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@linaro.org>
To: Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: oe-kbuild@lists.linux.dev, "André Apitzsch" <git@apitzsch.eu>,
	lkp@intel.com, oe-kbuild-all@lists.linux.dev,
	linux-media@vger.kernel.org,
	"Laurent Pinchart" <laurent.pinchart@ideasonboard.com>
Subject: Re: [sailus-media-tree:cleanup 30/54] drivers/media/i2c/imx214.c:1109 imx214_ctrls_init() error: we previously assumed 'imx214->link_freq' could be null (see line 1017)
Date: Wed, 27 Aug 2025 16:06:24 +0300	[thread overview]
Message-ID: <aK8C0InZVhV-VnXr@stanley.mountain> (raw)
In-Reply-To: <aK7MAiDuq6tqEW7X@kekkonen.localdomain>

On Wed, Aug 27, 2025 at 12:12:34PM +0300, Sakari Ailus wrote:
> > 4f302d004bd0fc André Apitzsch 2023-12-06  1012  
> > 4f302d004bd0fc André Apitzsch 2023-12-06  1013  	imx214->link_freq = v4l2_ctrl_new_int_menu(ctrl_hdlr, NULL,
> > 4f302d004bd0fc André Apitzsch 2023-12-06  1014  						   V4L2_CID_LINK_FREQ,
> > b9b359662952ff André Apitzsch 2025-05-24  1015  						   imx214->bus_cfg.nr_of_link_frequencies - 1,
> > b9b359662952ff André Apitzsch 2025-05-24  1016  						   0, imx214->bus_cfg.link_frequencies);
> > 4f302d004bd0fc André Apitzsch 2023-12-06 @1017  	if (imx214->link_freq)
> >                                                             ^^^^^^^^^^^^^^^^^
> > This assumes ->link_freq can be NULL.
> 
> This seems to be a false positive: the control handler's error is set if
> adding the LINK_FREQ control isn't successful and that is checked for later
> on, before calling imx214_pll_update(). Probably smatch can't figure that
> out?
> 

Yeah.  You're right.  Smatch knows that v4l2_ctrl_new() sets
ctrl_hdlr->error on failure but when it gets returned from
v4l2_ctrl_new_int_menu() then that information is lost.

I should investigate why that is...

Thanks for looking at this.

regards,
dan carpenter


      reply	other threads:[~2025-08-27 13:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-27  7:17 [sailus-media-tree:cleanup 30/54] drivers/media/i2c/imx214.c:1109 imx214_ctrls_init() error: we previously assumed 'imx214->link_freq' could be null (see line 1017) Dan Carpenter
2025-08-27  9:12 ` Sakari Ailus
2025-08-27 13:06   ` Dan Carpenter [this message]

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=aK8C0InZVhV-VnXr@stanley.mountain \
    --to=dan.carpenter@linaro.org \
    --cc=git@apitzsch.eu \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=oe-kbuild@lists.linux.dev \
    --cc=sakari.ailus@linux.intel.com \
    /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