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: Tue, 31 May 2016 15:20:18 +0200 From: Lars-Peter Clausen <lars@...afoo.de> To: Jonathan Cameron <jic23@...nel.org>, Daniel Baluta <daniel.baluta@...il.com>, Alison Schofield <amsfield22@...il.com> Cc: "Hennerich, Michael" <Michael.Hennerich@...log.com>, Hartmut Knaack <knaack.h@....de>, Peter Meerwald-Stadler <pmeerw@...erw.net>, "linux-iio@...r.kernel.org" <linux-iio@...r.kernel.org>, Linux Kernel Mailing List <linux-kernel@...r.kernel.org> Subject: Re: [PATCH 2/7] iio: adc: ad7791: claim direct mode when writing frequency On 05/29/2016 07:06 PM, Jonathan Cameron wrote: > On 25/05/16 11:34, Daniel Baluta wrote: >> On Tue, May 24, 2016 at 10:16 PM, Alison Schofield <amsfield22@...il.com> wrote: >>> Driver was checking for direct mode and trying to lock it, but >>> left a gap where mode could change before the desired operation. >>> Use iio_device_claim_direct_mode() to guarantee device stays in >>> direct mode. >>> >>> Signed-off-by: Alison Schofield <amsfield22@...il.com> >>> Cc: Daniel Baluta <daniel.baluta@...il.com> >> >> Looks good to me. We could use an Acked-by from Lars here. >> >> Acked-by: Daniel Baluta <daniel.baluta@...il.com> > This one is a little more interesting. I wonder if we wouldn't be better > off taking the lock for the whole function rather than dropping it for > short periods. It will only be locked once. sysfs_streq() will only match for a single item. But you are right the code could be refactored to make that more clearer. First run the lookup look and then apply afterwards.
Powered by blists - more mailing lists