diff options
author | Takashi Sakamoto <o-takashi@sakamocchi.jp> | 2023-01-20 18:03:43 +0900 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2023-01-23 09:17:44 +0100 |
commit | e699600232e0ca6237b996aa1a94a056cf776582 (patch) | |
tree | 46c95171972109b5a877597bf755e48109357230 /include/linux/firewire.h | |
parent | 13a55d6bb15fa6bf0dcaf997e0676f532f258f52 (diff) | |
download | lwn-e699600232e0ca6237b996aa1a94a056cf776582.tar.gz lwn-e699600232e0ca6237b996aa1a94a056cf776582.zip |
firewire: cdev: obsolete NULL check to detect IEC 61883-1 FCP region
In the character device, the listener to address space should distinguish
whether the request is to IEC 61883-1 FCP region or not. The user space
application needs to access to the object of request in enough later by
read(2), while the core function releases the object of request in the FCP
case after completing the callback to handler.
The handler guarantees the access safe by some way. It's done by
duplication of the object after NULL check to the request, since core
function passes NULL in the FCP case. It's inconvenient since the object
of request includes some helpful information. It's better to add another
way to check whether the request is to FCP region or not.
Conveniently the file of transaction layer includes local implementation
for the purpose. This commit moves it to module local file and use it
instead of the NULL check, then the result of check is stored to
per-client data for the inbound transaction so that the result can be
referred by later to release the data.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://lore.kernel.org/r/20230120090344.296451-3-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'include/linux/firewire.h')
-rw-r--r-- | include/linux/firewire.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/include/linux/firewire.h b/include/linux/firewire.h index 980019053e54..56505436d159 100644 --- a/include/linux/firewire.h +++ b/include/linux/firewire.h @@ -278,9 +278,8 @@ typedef void (*fw_transaction_callback_t)(struct fw_card *card, int rcode, * Otherwise there is a danger of recursion of inbound and outbound * transactions from and to the local node. * - * The callback is responsible that either fw_send_response() or kfree() - * is called on the @request, except for FCP registers for which the core - * takes care of that. + * The callback is responsible that fw_send_response() is called on the @request, except for FCP + * registers for which the core takes care of that. */ typedef void (*fw_address_callback_t)(struct fw_card *card, struct fw_request *request, |