Re: [PATCH 4.8 50/96] firmware: fix usermode helper fallback loading

From: Ben Gamari
Date: Fri Mar 24 2017 - 16:12:22 EST


Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> writes:

> On Fri, Jan 06, 2017 at 10:54:38PM +0100, Yves-Alexis Perez wrote:
>> On Fri, 2017-01-06 at 22:43 +0100, Greg Kroah-Hartman wrote:
>> > 4.8-stable review patch.ÂÂIf anyone has any objections, please let me know.
>>
>> Hi Greg,
>>
>> Ben Gamari think there was a regression in that patch so I'm adding him to
>> recipients so he can voice concerns if needed.
>
> Given the lack of response, I'm going to assume all is fine :)
>
Oh dear, sorry for the late response; this was stuck in the pergatory of
my inbox.

It's been a while since I've looked at this, but I believe the alleged
regression in this pastch is the reason I have the attached patch in my
tree. I seem to recall that it was the ath10k driver which triggered the
issue.

Unfortunately I can't recall which driver was affected by this. I'll
have to see what happens when I revert the attached patch.

Cheers,

- Ben



Author: Ben Gamari <ben@xxxxxxxxxxxxxxxx>
Date: Mon Jan 2 00:38:05 2017 -0500

firmware_class: Ensure buf is non-NULL in __fw_load_abort

I have observed that this can be NULL.

diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c
index ac350c518e0c..fd0be24911fc 100644
--- a/drivers/base/firmware_class.c
+++ b/drivers/base/firmware_class.c
@@ -546,7 +546,8 @@ static void __fw_load_abort(struct firmware_buf *buf)
* There is a small window in which user can write to 'loading'
* between loading done and disappearance of 'loading'
*/
- if (fw_state_is_done(&buf->fw_st))
+
+ if (!buf || fw_state_is_done(&buf->fw_st))
return;

list_del_init(&buf->pending_list);

Attachment: signature.asc
Description: PGP signature