linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Cc: linux-media@vger.kernel.org, Helen Koike <helen.koike@collabora.com>
Subject: Re: [PATCH 4/7] media-entity: set ent_enum->bmap to NULL after freeing it
Date: Fri, 22 Feb 2019 13:17:39 +0200	[thread overview]
Message-ID: <20190222111739.GM3522@pendragon.ideasonboard.com> (raw)
In-Reply-To: <20190221142148.3412-5-hverkuil-cisco@xs4all.nl>

Hi Hans,

Thank you for the patch.

On Thu, Feb 21, 2019 at 03:21:45PM +0100, Hans Verkuil wrote:
> Ensure that this pointer is set to NULL after it is freed.
> The vimc driver has a static media_entity and after
> unbinding and rebinding the vimc device the media code will
> try to free this pointer again since it wasn't set to NULL.

As this fixes a problem in vimc, should you add a Fixes: tag ? To avoid
other similar problems, I think the vimc driver should allocate the
media_device and other device data dynamically at probe time. Bundling
them with the platform_device in struct vimc_device isn't a good idea.

> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
> ---
>  drivers/media/media-entity.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/media/media-entity.c b/drivers/media/media-entity.c
> index 0b1cb3559140..7b2a2cc95530 100644
> --- a/drivers/media/media-entity.c
> +++ b/drivers/media/media-entity.c
> @@ -88,6 +88,7 @@ EXPORT_SYMBOL_GPL(__media_entity_enum_init);
>  void media_entity_enum_cleanup(struct media_entity_enum *ent_enum)
>  {
>  	kfree(ent_enum->bmap);
> +	ent_enum->bmap = NULL;
>  }
>  EXPORT_SYMBOL_GPL(media_entity_enum_cleanup);
>  

-- 
Regards,

Laurent Pinchart

  reply	other threads:[~2019-02-22 11:17 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-21 14:21 [PATCH 0/7] Various core and virtual driver fixes Hans Verkuil
2019-02-21 14:21 ` [PATCH 1/7] cec: fill in cec chardev kobject to ease debugging Hans Verkuil
2019-02-22 11:10   ` Laurent Pinchart
2019-02-21 14:21 ` [PATCH 2/7] media-devnode: fill in media " Hans Verkuil
2019-02-22 11:07   ` Laurent Pinchart
2019-02-21 14:21 ` [PATCH 3/7] vivid: use vzalloc for dev->bitmap_out Hans Verkuil
2019-02-22 11:09   ` Laurent Pinchart
2019-02-21 14:21 ` [PATCH 4/7] media-entity: set ent_enum->bmap to NULL after freeing it Hans Verkuil
2019-02-22 11:17   ` Laurent Pinchart [this message]
2019-02-25 11:25     ` Hans Verkuil
2019-02-21 14:21 ` [PATCH 5/7] vim2m: replace devm_kzalloc by kzalloc Hans Verkuil
2019-02-22 11:20   ` Laurent Pinchart
2019-02-25 11:27     ` Hans Verkuil
2019-02-21 14:21 ` [PATCH 6/7] v4l2-device: v4l2_device_release_subdev_node can't reference sd Hans Verkuil
2019-02-22 11:32   ` Laurent Pinchart
2019-03-01 11:46     ` Hans Verkuil
2019-03-05 19:36       ` Laurent Pinchart
2019-02-21 14:21 ` [PATCH 7/7] vimc: free vimc_cap_device when the last user disappears Hans Verkuil
2019-02-22 11:37   ` Laurent Pinchart

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=20190222111739.GM3522@pendragon.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=helen.koike@collabora.com \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=linux-media@vger.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;
as well as URLs for NNTP newsgroup(s).