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
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAPybu_1fw6qEmeXPrJVsTAoiY5=athE6FaakXznnbzd7fE7shw@mail.gmail.com>
Date:	Fri, 13 Feb 2015 16:47:36 +0100
From:	Ricardo Ribalda Delgado <ricardo.ribalda@...il.com>
To:	Hans Verkuil <hverkuil@...all.nl>
Cc:	Pawel Osciak <pawel@...iak.com>,
	Marek Szyprowski <m.szyprowski@...sung.com>,
	Kyungmin Park <kyungmin.park@...sung.com>,
	Mauro Carvalho Chehab <mchehab@....samsung.com>,
	linux-media <linux-media@...r.kernel.org>,
	LKML <linux-kernel@...r.kernel.org>,
	Hans Verkuil <hans.verkuil@...co.com>,
	martin.petersen@...cle.com, hch@....de, tonyb@...ernetics.com,
	axboe@...com, Stephen Rothwell <sfr@...b.auug.org.au>,
	lauraa@...eaurora.org,
	Benjamin Herrenschmidt <benh@...nel.crashing.org>,
	webbnh@...com, hare@...e.de,
	Andrew Morton <akpm@...ux-foundation.org>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: Re: [PATCH v2 1/3] media/videobuf2-dma-sg: Fix handling of sg_table structure

Hello all

On Fri, Feb 13, 2015 at 4:32 PM, Hans Verkuil <hverkuil@...all.nl> wrote:

> Yes please. And if Ricardo is correct, then someone (janitor job?) should do
> a review of dma_unmap_sg in particular.

Perhaps a code snippet inside scatterlist.h will clarify even more.

Would any of the maintainers accept a patch to include a comment like:

struct sg_table *sgt;

sgt = kzalloc(sizeof(*sgt);
if (!sgt){
return -ENOMEM;
}

ret = sg_alloc_table(sgt, N_NENTS, GPF_KERNEL);
if (ret){
  kfree(sgt);
  return ret;
}

//Fill sgt using orig_nents or nents  as index

sgt->nents = dma_map_sg(dev, sgt->sgl, sgt->orig_nents, DIR);
if (!sgt->nents){
  sg_free_table(sgt);
  kfree(sgt);
  return -EIO;
}

//Use nent  as index

dma_unmap_sg(dev, sgt->sgl, sgt->orig_nents, DIR);
sg_free_table(sgt);
kfree(sgt);
return 0



Thanks!


-- 
Ricardo Ribalda
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ