All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Cc: linux-media@vger.kernel.org,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Hans Verkuil <hverkuil@xs4all.nl>,
	Sakari Ailus <sakari.ailus@linux.intel.com>
Subject: Re: [PATCH v3 4/5] media: v4l2-subdev: v4l2_subdev_free_state() to accept a NULL state
Date: Thu, 10 Jun 2021 14:26:28 +0300	[thread overview]
Message-ID: <YMH25MJfvIu9hIta@pendragon.ideasonboard.com> (raw)
In-Reply-To: <20210610094903.343183-3-tomi.valkeinen@ideasonboard.com>

Hi Tomi,

Thank you for the patch.

On Thu, Jun 10, 2021 at 12:49:02PM +0300, Tomi Valkeinen wrote:
> Make v4l2_subdev_free_state() accept a NULL state.
> 
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
> ---
>  drivers/media/v4l2-core/v4l2-subdev.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c
> index dacae53b68d5..25c80d6de23b 100644
> --- a/drivers/media/v4l2-core/v4l2-subdev.c
> +++ b/drivers/media/v4l2-core/v4l2-subdev.c
> @@ -931,7 +931,8 @@ EXPORT_SYMBOL_GPL(v4l2_subdev_alloc_state);
>  
>  void v4l2_subdev_free_state(struct v4l2_subdev_state *state)
>  {
> -	kvfree(state->pads);
> +	if (state)
> +		kvfree(state->pads);
>  	kfree(state);

I'd write

	if (!state)
		return;

as I expect we'll have more code in the future.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

>  }
>  EXPORT_SYMBOL_GPL(v4l2_subdev_free_state);

-- 
Regards,

Laurent Pinchart

  reply	other threads:[~2021-06-10 11:26 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-09 10:02 [PATCH v3 0/1] media: v4l2-subdev: add subdev-wide state struct Tomi Valkeinen
     [not found] ` <20210609100228.278798-2-tomi.valkeinen@ideasonboard.com>
2021-06-10  8:00   ` [PATCH v3 1/1] " Hans Verkuil
2021-06-10  8:24     ` Tomi Valkeinen
2021-06-10 11:11     ` Laurent Pinchart
2021-06-10  9:49 ` [PATCH v3 2/5] media: omap3isp: fix indentation Tomi Valkeinen
2021-06-10  9:49   ` [PATCH v3 3/5] media: fix kernel doc errors for sd_state parameter Tomi Valkeinen
2021-06-10 11:25     ` Laurent Pinchart
2021-06-10  9:49   ` [PATCH v3 4/5] media: v4l2-subdev: v4l2_subdev_free_state() to accept a NULL state Tomi Valkeinen
2021-06-10 11:26     ` Laurent Pinchart [this message]
2021-06-10  9:49   ` [PATCH v3 5/5] media: v4l2-subdev: fix and rename check_cfg() Tomi Valkeinen
2021-06-10 11:26     ` Laurent Pinchart
2021-06-10 11:23   ` [PATCH v3 2/5] media: omap3isp: fix indentation Laurent Pinchart
2021-06-10  9:51 ` [PATCH v3 0/1] media: v4l2-subdev: add subdev-wide state struct Tomi Valkeinen
2021-06-10  9:54   ` Hans Verkuil

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=YMH25MJfvIu9hIta@pendragon.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=hverkuil@xs4all.nl \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.