* [PATCH] USB: legousbtower: use stream_open for stream semantics
@ 2026-10-28 18:28 mdshahid03
2026-10-28 18:32 ` sashiko-bot
0 siblings, 1 reply; 2+ messages in thread
From: mdshahid03 @ 2026-10-28 18:28 UTC (permalink / raw)
To: starblue, gregkh; +Cc: legousb-devel, linux-usb, linux-kernel, Mohammad Shahid
From: Mohammad Shahid <mdshahid03@gmail.com>
The LEGO USB Tower driver uses nonseekable_open() in tower_open()
However, its read and write have stream semantics.
Use stream_open instead to mark the file as a stream and disable
unnecessary file position handling.
The issue is reported by stream_open.cocci script as potential
deadlock between read and write operation.
Signed-off-by: Mohammad Shahid <mdshahid03@gmail.com>
---
drivers/usb/misc/legousbtower.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/misc/legousbtower.c b/drivers/usb/misc/legousbtower.c
index 18dd4115befb..b849bd0e9664 100644
--- a/drivers/usb/misc/legousbtower.c
+++ b/drivers/usb/misc/legousbtower.c
@@ -313,7 +313,7 @@ static int tower_open(struct inode *inode, struct file *file)
struct tower_reset_reply reset_reply;
int result;
- nonseekable_open(inode, file);
+ stream_open(inode, file);
subminor = iminor(inode);
interface = usb_find_interface(&tower_driver, subminor);
--
2.43.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] USB: legousbtower: use stream_open for stream semantics
2026-10-28 18:28 [PATCH] USB: legousbtower: use stream_open for stream semantics mdshahid03
@ 2026-10-28 18:32 ` sashiko-bot
0 siblings, 0 replies; 2+ messages in thread
From: sashiko-bot @ 2026-10-28 18:32 UTC (permalink / raw)
To: mdshahid03; +Cc: linux-usb
> From: Mohammad Shahid <mdshahid03@gmail.com>
>
> The LEGO USB Tower driver uses nonseekable_open() in tower_open()
> However, its read and write have stream semantics.
>
> Use stream_open instead to mark the file as a stream and disable
> unnecessary file position handling.
>
> The issue is reported by stream_open.cocci script as potential
> deadlock between read and write operation.
>
> Signed-off-by: Mohammad Shahid <mdshahid03@gmail.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261028182802.25212-1-mdshahid03@gmail.com?part=1
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-10-28 18:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-28 18:28 [PATCH] USB: legousbtower: use stream_open for stream semantics mdshahid03
2026-10-28 18:32 ` sashiko-bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox