lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <udogxn4kbihht7isswwwofra373lotxtfvyj7kwxbe3436fjsp@4yxggpana75c>
Date:   Tue, 25 Apr 2023 11:04:43 +0200
From:   Benjamin Tissoires <benjamin.tissoires@...hat.com>
To:     Mubashshir <ahmubashshir@...il.com>
Cc:     Jiri Kosina <jikos@...nel.org>,
        Huseyin BIYIK <huseyinbiyik@...mail.com>,
        linux-kernel@...r.kernel.org, linux-input@...r.kernel.org
Subject: Re: [PATCH v3] staging: HID: Add ShanWan USB WirelessGamepad driver

On Apr 19 2023, Mubashshir wrote:
> On Thu, Apr 13 2023 at 06:13:05 PM +02:00:00, Benjamin Tissoires
> <benjamin.tissoires@...hat.com> wrote:
> > What's the point of keeping it opened for the lifetime of the device? Do
> > you really need this?
> > 
> > >  +	if (error) {
> > >  +		dev_err(&hdev->dev, "hw open failed\n");
> > >  +		hid_hw_stop(hdev);
> > >  +		return error;
> > >  +	}
> > >  +
> > >  +	return 0;
> > >  +}
> > >  +
> > >  +static void shanwan_remove(struct hid_device *hdev)
> > >  +{
> > >  +	hid_hw_close(hdev);
> > 
> > If you can drop the last hid_hw_open/close, then you can entirely skip
> > the ->remove().
> 
> Would hid_hw_request work without open device?

No, it won't work if the device is not opened. But what's the point of
sending rumble data to the joystick if the device is not opened (so used)
by anybody? open() is called whenever a client opens the device, by
accessing the evdev node, so I think it should be fine.

Cheers,
Benjamin

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ