lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Mon, 11 Mar 2019 16:30:04 +0100 From: Hans Verkuil <hverkuil@...all.nl> To: Souptick Joarder <jrdr.linux@...il.com>, pawel@...iak.com, Marek Szyprowski <m.szyprowski@...sung.com>, Kyungmin Park <kyungmin.park@...sung.com>, mchehab@...nel.org, Nicolas Dufresne <nicolas@...fresne.ca> Cc: linux-media@...r.kernel.org, linux-kernel@...r.kernel.org Subject: Re: [PATCHv2] media: videobuf2: Return error after allocation failure On 3/1/19 4:04 AM, Souptick Joarder wrote: > On Mon, Feb 11, 2019 at 7:42 AM Souptick Joarder <jrdr.linux@...il.com> wrote: >> >> On Mon, Feb 4, 2019 at 8:27 PM Souptick Joarder <jrdr.linux@...il.com> wrote: >>> >>> There is no point to continuing assignment after memory allocation >>> failed, rather throw error immediately. >>> >>> Signed-off-by: Souptick Joarder <jrdr.linux@...il.com> >> >> Any comment on this patch ? > > If no further comment, can we get this patch in queue for 5.1 ? 5.1 was too late, but it will certainly go into 5.2. Regards, Hans >> >>> --- >>> v1 -> v2: >>> Corrected typo in change log. >>> >>> drivers/media/common/videobuf2/videobuf2-vmalloc.c | 8 ++++---- >>> 1 file changed, 4 insertions(+), 4 deletions(-) >>> >>> diff --git a/drivers/media/common/videobuf2/videobuf2-vmalloc.c b/drivers/media/common/videobuf2/videobuf2-vmalloc.c >>> index 6dfbd5b..d3f71e2 100644 >>> --- a/drivers/media/common/videobuf2/videobuf2-vmalloc.c >>> +++ b/drivers/media/common/videobuf2/videobuf2-vmalloc.c >>> @@ -46,16 +46,16 @@ static void *vb2_vmalloc_alloc(struct device *dev, unsigned long attrs, >>> >>> buf->size = size; >>> buf->vaddr = vmalloc_user(buf->size); >>> - buf->dma_dir = dma_dir; >>> - buf->handler.refcount = &buf->refcount; >>> - buf->handler.put = vb2_vmalloc_put; >>> - buf->handler.arg = buf; >>> >>> if (!buf->vaddr) { >>> pr_debug("vmalloc of size %ld failed\n", buf->size); >>> kfree(buf); >>> return ERR_PTR(-ENOMEM); >>> } >>> + buf->dma_dir = dma_dir; >>> + buf->handler.refcount = &buf->refcount; >>> + buf->handler.put = vb2_vmalloc_put; >>> + buf->handler.arg = buf; >>> >>> refcount_set(&buf->refcount, 1); >>> return buf; >>> -- >>> 1.9.1 >>>
Powered by blists - more mailing lists