* [PATCH] USB: legousbtower: use stream_open for stream semantics
@ 2026-10-28 18:28 mdshahid03
0 siblings, 0 replies; only message 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 [flat|nested] only message in thread
only message in thread, other threads:[~2026-10-28 18:28 UTC | newest]
Thread overview: (only message) (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
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®