Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@linaro.org>
To: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
	Hans Verkuil <hverkuil@kernel.org>,
	Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org
Subject: Re: [PATCH] media: v4l2-subdev: Fix alloc failure check in v4l2_subdev_call_state_try()
Date: Fri, 8 Aug 2025 16:54:36 +0300	[thread overview]
Message-ID: <aJYBnGXMYOzhgRPh@stanley.mountain> (raw)
In-Reply-To: <20250808-fix-subdev-call-state-try-v1-1-000676e46754@ideasonboard.com>

On Fri, Aug 08, 2025 at 11:59:15AM +0300, Tomi Valkeinen wrote:
> v4l2_subdev_call_state_try() macro allocates a subdev state with
> __v4l2_subdev_state_alloc(), but does not check the returned value. If
> __v4l2_subdev_state_alloc fails, it returns an ERR_PTR, and that would
> cause v4l2_subdev_call_state_try() to crash.
> 
> Add proper error handling to v4l2_subdev_call_state_try().
> 
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
> Fixes: 982c0487185b ("media: subdev: Add v4l2_subdev_call_state_try() macro")
> Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
> Closes: https://lore.kernel.org/all/aJTNtpDUbTz7eyJc%40stanley.mountain/
> Cc: stable@vger.kernel.org

Looks good.  Thanks!

Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>

regards,
dan carpenter


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

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-08  8:59 [PATCH] media: v4l2-subdev: Fix alloc failure check in v4l2_subdev_call_state_try() Tomi Valkeinen
2025-08-08 13:54 ` 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=aJYBnGXMYOzhgRPh@stanley.mountain \
    --to=dan.carpenter@linaro.org \
    --cc=hverkuil@kernel.org \
    --cc=laurent.pinchart+renesas@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    --cc=stable@vger.kernel.org \
    --cc=tomi.valkeinen@ideasonboard.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