linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Input: serio - fix blocking of parport
@ 2015-09-26 13:23 Sudip Mukherjee
  2015-09-28  0:18 ` Dmitry Torokhov
  0 siblings, 1 reply; 3+ messages in thread
From: Sudip Mukherjee @ 2015-09-26 13:23 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-kernel, linux-input, Sudip Mukherjee, stable

If parkbd_allocate_serio() fails to allocate memory we are releasing the
parport but we missed unregistering the device. As a result this device
with exclusive access to that parport remains registered. And no other
device will be able to use that parport even though this driver has
failed to load.

Cc: <stable@vger.kernel.org> # 2.6.32+
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---

Faced this problem while creating the patch series for input to use
parallel port device model.

 drivers/input/serio/parkbd.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/input/serio/parkbd.c b/drivers/input/serio/parkbd.c
index 26b4593..1e8cd6f 100644
--- a/drivers/input/serio/parkbd.c
+++ b/drivers/input/serio/parkbd.c
@@ -194,6 +194,7 @@ static int __init parkbd_init(void)
 	parkbd_port = parkbd_allocate_serio();
 	if (!parkbd_port) {
 		parport_release(parkbd_dev);
+		parport_unregister_device(parkbd_dev);
 		return -ENOMEM;
 	}
 
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Input: serio - fix blocking of parport
  2015-09-26 13:23 [PATCH] Input: serio - fix blocking of parport Sudip Mukherjee
@ 2015-09-28  0:18 ` Dmitry Torokhov
  2015-09-28 13:41   ` Sudip Mukherjee
  0 siblings, 1 reply; 3+ messages in thread
From: Dmitry Torokhov @ 2015-09-28  0:18 UTC (permalink / raw)
  To: Sudip Mukherjee; +Cc: linux-kernel, linux-input, stable

On Sat, Sep 26, 2015 at 06:53:21PM +0530, Sudip Mukherjee wrote:
> If parkbd_allocate_serio() fails to allocate memory we are releasing the
> parport but we missed unregistering the device. As a result this device
> with exclusive access to that parport remains registered. And no other
> device will be able to use that parport even though this driver has
> failed to load.
> 
> Cc: <stable@vger.kernel.org> # 2.6.32+
> Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>

Applied, but I dropped stable annotation - since noone complained about
this and the issue is in error path that is unlikely anyway, I do not
think we need to bother stable guys with it.

Thanks!

> ---
> 
> Faced this problem while creating the patch series for input to use
> parallel port device model.
> 
>  drivers/input/serio/parkbd.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/input/serio/parkbd.c b/drivers/input/serio/parkbd.c
> index 26b4593..1e8cd6f 100644
> --- a/drivers/input/serio/parkbd.c
> +++ b/drivers/input/serio/parkbd.c
> @@ -194,6 +194,7 @@ static int __init parkbd_init(void)
>  	parkbd_port = parkbd_allocate_serio();
>  	if (!parkbd_port) {
>  		parport_release(parkbd_dev);
> +		parport_unregister_device(parkbd_dev);
>  		return -ENOMEM;
>  	}
>  
> -- 
> 1.9.1
> 

-- 
Dmitry

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Input: serio - fix blocking of parport
  2015-09-28  0:18 ` Dmitry Torokhov
@ 2015-09-28 13:41   ` Sudip Mukherjee
  0 siblings, 0 replies; 3+ messages in thread
From: Sudip Mukherjee @ 2015-09-28 13:41 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-kernel, linux-input

On Sun, Sep 27, 2015 at 05:18:08PM -0700, Dmitry Torokhov wrote:
> On Sat, Sep 26, 2015 at 06:53:21PM +0530, Sudip Mukherjee wrote:
> > If parkbd_allocate_serio() fails to allocate memory we are releasing the
> > parport but we missed unregistering the device. As a result this device
> > with exclusive access to that parport remains registered. And no other
> > device will be able to use that parport even though this driver has
> > failed to load.
> > 
> > Cc: <stable@vger.kernel.org> # 2.6.32+
> > Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
> 
> Applied, but I dropped stable annotation - since noone complained about
> this and the issue is in error path that is unlikely anyway, I do not
> think we need to bother stable guys with it.
Ok. Thanks.
BTW, I have two more patches waiting for your review.
1) Input: cyapa: remove variable overwriting
2) Input: omap-keypad: fix memory leak

Did you get a chance to have a look at them?

regards
sudip

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-09-28 13:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-26 13:23 [PATCH] Input: serio - fix blocking of parport Sudip Mukherjee
2015-09-28  0:18 ` Dmitry Torokhov
2015-09-28 13:41   ` Sudip Mukherjee

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).