firewire: cdev: obsolete NULL check to detect IEC 61883-1 FCP region
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Fri, 20 Jan 2023 09:03:43 +0000 (18:03 +0900)
committerTakashi Iwai <tiwai@suse.de>
Mon, 23 Jan 2023 08:17:44 +0000 (09:17 +0100)
commite699600232e0ca6237b996aa1a94a056cf776582
tree46c95171972109b5a877597bf755e48109357230
parent13a55d6bb15fa6bf0dcaf997e0676f532f258f52
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>
drivers/firewire/core-cdev.c
drivers/firewire/core-transaction.c
drivers/firewire/core.h
include/linux/firewire.h