LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH 3/4] HID: hidraw, fix lock imbalance
@ 2008-10-21 21:27 Jiri Slaby
  2008-10-21 21:27 ` [PATCH 4/4] HID: hiddev, " Jiri Slaby
  0 siblings, 1 reply; 2+ messages in thread
From: Jiri Slaby @ 2008-10-21 21:27 UTC (permalink / raw)
  To: jkosina; +Cc: linux-input, linux-kernel, Jiri Slaby

Add omitted unlock_kernel() to hidraw_ioctl().
Added in 979c407e3b89b606e810fa494ef316896eadbfad
(HID: Push down BKL into ioctl handler in hidraw).

Corresponing sparse warning:
drivers/hid/hidraw.c:267:9: warning: context imbalance in 'hidraw_ioctl': wrong count at exit
drivers/hid/hidraw.c:267:9:    context 'kernel_lock': wanted 0, got 1

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
---
 drivers/hid/hidraw.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/hid/hidraw.c b/drivers/hid/hidraw.c
index dffd464..f801755 100644
--- a/drivers/hid/hidraw.c
+++ b/drivers/hid/hidraw.c
@@ -264,6 +264,7 @@ static long hidraw_ioctl(struct file *file, unsigned int cmd,
 		default:
 			ret = -ENOTTY;
 	}
+	unlock_kernel();
 	return ret;
 }
 
-- 
1.6.0.2


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

* [PATCH 4/4] HID: hiddev, fix lock imbalance
  2008-10-21 21:27 [PATCH 3/4] HID: hidraw, fix lock imbalance Jiri Slaby
@ 2008-10-21 21:27 ` Jiri Slaby
  0 siblings, 0 replies; 2+ messages in thread
From: Jiri Slaby @ 2008-10-21 21:27 UTC (permalink / raw)
  To: jkosina; +Cc: linux-input, linux-kernel, Jiri Slaby

Don't forget to unlock_kernel() in hiddev_ioctl_usage().
Added in 7961df16819085b8a357720d89d0239036e6af2a
(HID: Switch hiddev to unlocked_ioctl).

Corresponing sparse warning:
drivers/hid/usbhid/hiddev.c:515:10: warning: context imbalance in 'hiddev_ioctl_usage': wrong count at exit
drivers/hid/usbhid/hiddev.c:515:10:    context 'kernel_lock': wanted 0, got 1

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
---
 drivers/hid/usbhid/hiddev.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/hid/usbhid/hiddev.c b/drivers/hid/usbhid/hiddev.c
index babd65d..3ac3207 100644
--- a/drivers/hid/usbhid/hiddev.c
+++ b/drivers/hid/usbhid/hiddev.c
@@ -436,8 +436,7 @@ static noinline int hiddev_ioctl_usage(struct hiddev *hiddev, unsigned int cmd,
 		if (copy_to_user(user_arg, uref, sizeof(*uref)))
 			goto fault;
 
-		kfree(uref_multi);
-		return 0;
+		goto goodreturn;
 
 	default:
 		if (cmd != HIDIOCGUSAGE &&
-- 
1.6.0.2


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

end of thread, other threads:[~2008-10-21 21:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-21 21:27 [PATCH 3/4] HID: hidraw, fix lock imbalance Jiri Slaby
2008-10-21 21:27 ` [PATCH 4/4] HID: hiddev, " Jiri Slaby

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).