From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Hans Verkuil <hverkuil@xs4all.nl>
Cc: linux-media@vger.kernel.org, pawel@osciak.com,
m.szyprowski@samsung.com, Hans Verkuil <hans.verkuil@cisco.com>
Subject: Re: [REVIEWv7 PATCH 04/12] vb2: don't free alloc context if it is ERR_PTR
Date: Wed, 26 Nov 2014 21:57:16 +0200 [thread overview]
Message-ID: <2976231.bHTBT3GSj5@avalon> (raw)
In-Reply-To: <1416315068-22936-5-git-send-email-hverkuil@xs4all.nl>
Hi Hans,
Thank you for the patch.
On Tuesday 18 November 2014 13:51:00 Hans Verkuil wrote:
> From: Hans Verkuil <hans.verkuil@cisco.com>
>
> Don't try to free a pointer containing an ERR_PTR().
Wouldn't it be easier to return NULL from vb2_dma_contig_alloc_ctx() instead
of an ERR_PTR ?
> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
> ---
> drivers/media/v4l2-core/videobuf2-dma-contig.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/media/v4l2-core/videobuf2-dma-contig.c
> b/drivers/media/v4l2-core/videobuf2-dma-contig.c index c4305bf..0bfc488
> 100644
> --- a/drivers/media/v4l2-core/videobuf2-dma-contig.c
> +++ b/drivers/media/v4l2-core/videobuf2-dma-contig.c
> @@ -854,7 +854,8 @@ EXPORT_SYMBOL_GPL(vb2_dma_contig_init_ctx);
>
> void vb2_dma_contig_cleanup_ctx(void *alloc_ctx)
> {
> - kfree(alloc_ctx);
> + if (!IS_ERR_OR_NULL(alloc_ctx))
> + kfree(alloc_ctx);
> }
> EXPORT_SYMBOL_GPL(vb2_dma_contig_cleanup_ctx);
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2014-11-26 19:56 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-18 12:50 [REVIEWv7 PATCH 00/12] vb2: improve dma-sg, expbuf Hans Verkuil
2014-11-18 12:50 ` [REVIEWv7 PATCH 01/12] videobuf2-core.h: improve documentation Hans Verkuil
2014-11-23 11:01 ` Pawel Osciak
2014-11-26 19:48 ` Laurent Pinchart
2014-11-18 12:50 ` [REVIEWv7 PATCH 02/12] vb2: replace 'write' by 'dma_dir' Hans Verkuil
2014-11-26 19:50 ` Laurent Pinchart
2014-11-18 12:50 ` [REVIEWv7 PATCH 03/12] vb2: add dma_dir to the alloc memop Hans Verkuil
2014-11-26 19:53 ` Laurent Pinchart
2014-11-18 12:51 ` [REVIEWv7 PATCH 04/12] vb2: don't free alloc context if it is ERR_PTR Hans Verkuil
2014-11-23 10:19 ` Pawel Osciak
2014-11-26 19:57 ` Laurent Pinchart [this message]
2014-11-18 12:51 ` [REVIEWv7 PATCH 05/12] vb2-dma-sg: add allocation context to dma-sg Hans Verkuil
2014-11-23 10:36 ` Pawel Osciak
2014-11-26 20:01 ` Laurent Pinchart
2014-11-27 8:38 ` Hans Verkuil
2014-11-18 12:51 ` [REVIEWv7 PATCH 06/12] vb2-dma-sg: move dma_(un)map_sg here Hans Verkuil
2014-11-26 20:43 ` Laurent Pinchart
2014-11-27 8:48 ` Hans Verkuil
2014-11-18 12:51 ` [REVIEWv7 PATCH 07/12] vb2-dma-sg: add dmabuf import support Hans Verkuil
2014-11-26 21:00 ` Laurent Pinchart
2014-11-27 9:02 ` Hans Verkuil
2014-12-01 22:46 ` Laurent Pinchart
2014-12-02 7:35 ` Hans Verkuil
2014-11-18 12:51 ` [REVIEWv7 PATCH 08/12] vb2-dma-sg: add support for dmabuf exports Hans Verkuil
2014-11-18 12:51 ` [REVIEWv7 PATCH 09/12] vb2-vmalloc: " Hans Verkuil
2014-11-23 10:52 ` Pawel Osciak
2014-11-18 12:51 ` [REVIEWv7 PATCH 10/12] vivid: enable vb2_expbuf support Hans Verkuil
2014-11-26 20:46 ` Laurent Pinchart
2014-11-18 12:51 ` [REVIEWv7 PATCH 11/12] vim2m: support expbuf Hans Verkuil
2014-11-26 20:46 ` Laurent Pinchart
2014-11-18 12:51 ` [REVIEWv7 PATCH 12/12] vb2: use dma_map_sg_attrs to prevent unnecessary sync Hans Verkuil
2014-11-23 10:55 ` Pawel Osciak
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=2976231.bHTBT3GSj5@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=hans.verkuil@cisco.com \
--cc=hverkuil@xs4all.nl \
--cc=linux-media@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=pawel@osciak.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