[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+55aFw0pB99ztq5YUS56db-ijdxzevA=mvY3ce5O_yujVFOcA@mail.gmail.com>
Date: Wed, 3 Oct 2012 10:32:08 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Al Viro <viro@...iv.linux.org.uk>
Cc: Mauro Carvalho Chehab <mchehab@...hat.com>,
Ming Lei <ming.lei@...onical.com>,
Greg KH <gregkh@...uxfoundation.org>,
Kay Sievers <kay@...y.org>,
Lennart Poettering <lennart@...ttering.net>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Kay Sievers <kay@...hat.com>,
Linux Media Mailing List <linux-media@...r.kernel.org>,
Michael Krufky <mkrufky@...uxtv.org>,
Ivan Kalvachev <ikalvachev@...il.com>
Subject: Re: udev breakages - was: Re: Need of an ".async_probe()" type of
callback at driver's core - Was: Re: [PATCH] [media] drxk: change it to use request_firmware_nowait()
On Wed, Oct 3, 2012 at 10:09 AM, Al Viro <viro@...iv.linux.org.uk> wrote:
>
> + if (!S_ISREG(inode->i_mode))
> + return false;
> + size = i_size_read(inode);
>
> Probably better to do vfs_getattr() and check mode and size in kstat; if
> it's sufficiently hot for that to hurt, we are fucked anyway.
>
> + file = filp_open(path, O_RDONLY, 0);
> + if (IS_ERR(file))
> + continue;
> +printk("from file '%s' ", path);
> + success = fw_read_file_contents(file, fw);
> + filp_close(file, NULL);
>
> fput(file), please. We have enough misuses of filp_close() as it is...
Ok, like this?
Linus
Download attachment "patch.diff" of type "application/octet-stream" (2814 bytes)
Powered by blists - more mailing lists