From: Mauricio Faria de Oliveira <mfo@igalia.com>
To: Stanislaw Gruszka <stf_xl@wp.pl>
Cc: Matthieu CASTET <castet.matthieu@free.fr>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Andrew Morton <akpm@osdl.org>,
kernel-dev@igalia.com, linux-usb@vger.kernel.org,
linux-kernel@vger.kernel.org,
Andrey Tsygunka <aitsygunka@yandex.ru>,
syzbot+ce1e5a1b4e086b43e56d@syzkaller.appspotmail.com,
syzbot+306212936b13e520679d@syzkaller.appspotmail.com,
syzbot+457452d30bcdda75ead2@syzkaller.appspotmail.com
Subject: Re: [PATCH v2] usb: atm: ueagle-atm: wait for pre-firmware load in .disconnect()
Date: Tue, 26 May 2026 14:13:49 -0300 [thread overview]
Message-ID: <c374af62869016d43f54345c5fad62f3@igalia.com> (raw)
In-Reply-To: <20260526092456.GA45806@wp.pl>
On 2026-05-26 06:24, Stanislaw Gruszka wrote:
> Hi,
>
> On Fri, May 22, 2026 at 01:45:35PM -0300, Mauricio Faria de Oliveira wrote:
[...]
>> @@ -2557,8 +2561,23 @@ static int uea_probe(struct usb_interface *intf, const struct usb_device_id *id)
>>
>> usb_reset_device(usb);
>>
>> - if (UEA_IS_PREFIRM(id))
>> - return uea_load_firmware(usb, UEA_CHIP_VERSION(id));
>> + if (UEA_IS_PREFIRM(id)) {
>> + struct completion *fw_done;
>> +
>> + /* Wait for the firmware load to be done, in .disconnect() */
>> + fw_done = kzalloc_obj(*fw_done);
>> + if (!fw_done)
>> + return -ENOMEM;
>> +
>> + init_completion(fw_done);
>> + usb_set_intfdata(intf, fw_done);
>> +
>> + ret = uea_load_firmware(intf, UEA_CHIP_VERSION(id));
>> + if (ret)
>> + complete(fw_done);
>> +
>> + return ret;
>
> If uea_probe() returns an error, .disconnect() should not be called
> so complete(fw_done) is not needed. On error path we should just do
> kfree(fw_done), right ?
>
> Otherwise, the patch looks good to me.
You're right; thanks for catching this.
Tested and fixed in v3:
https://lore.kernel.org/all/20260526-ueagle-atm_req-fw-sync-v3-1-93c01961daaf@igalia.com/
>
> Regards
> Stanislaw
[...]
--
Mauricio
prev parent reply other threads:[~2026-05-26 17:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-22 16:45 Mauricio Faria de Oliveira
2026-05-26 9:24 ` Stanislaw Gruszka
2026-05-26 17:13 ` Mauricio Faria de Oliveira [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c374af62869016d43f54345c5fad62f3@igalia.com \
--to=mfo@igalia.com \
--cc=aitsygunka@yandex.ru \
--cc=akpm@osdl.org \
--cc=castet.matthieu@free.fr \
--cc=gregkh@linuxfoundation.org \
--cc=kernel-dev@igalia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=stf_xl@wp.pl \
--cc=syzbot+306212936b13e520679d@syzkaller.appspotmail.com \
--cc=syzbot+457452d30bcdda75ead2@syzkaller.appspotmail.com \
--cc=syzbot+ce1e5a1b4e086b43e56d@syzkaller.appspotmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®