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] [day] [month] [year] [list]
Message-ID: <alpine.LNX.2.00.1202071342540.24127@pobox.suse.cz>
Date:	Tue, 7 Feb 2012 13:43:31 +0100 (CET)
From:	Jiri Kosina <jkosina@...e.cz>
To:	Przemo Firszt <przemo@...szt.eu>
Cc:	Jeremy Fitzhardinge <jeremy@...p.org>, chris@...bagwell.com,
	pinglinux@...il.com, linuxwacom-devel@...ts.sourceforge.net,
	linux-input@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] HID: wacom: Fix invalid power_supply_powers calls

On Mon, 6 Feb 2012, przemo@...szt.eu wrote:

> >>>> Hmm, seems valid. How did you notice? Have you seen crashes because of
> >>>> wild pointers?
> >>> Hi Jiri,
> >>> Yes, the driver was unusable - 100% crashes during connection.
> >> Okay, I thought that'd be the case.
> >
> > Very sorry about that.  I don't have a device to test with, so I should
> > have reviewed the code extra carefully.
> >
> > Does the same bug apply to the Wii changes, which were of the same form?
> >
> Hi Jeremy,
> The wii code looks the same, so probably it's affected as well. Can you
> make a patch?
> 
> power_supply_powers call in wiimote driver:
> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=blob;f=drivers/hid/hid-wiimote-core.c#l1229

I have now queued the patch below for the same pile as well.
Thanks for spotting it.


From: Jiri Kosina <jkosina@...e.cz>
Subject: [PATCH] HID: wiimote: fix invalid power_supply_powers call

Analogically to d7cb3dbd1 ("HID: wacom: Fix invalid power_supply_powers
calls"), fix also the same occurence in wiimote driver.

Reported-by: przemo@...szt.eu
Signed-off-by: Jiri Kosina <jkosina@...e.cz>
---
 drivers/hid/hid-wiimote-core.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/hid/hid-wiimote-core.c b/drivers/hid/hid-wiimote-core.c
index fc253b4..cac3589 100644
--- a/drivers/hid/hid-wiimote-core.c
+++ b/drivers/hid/hid-wiimote-core.c
@@ -1226,14 +1226,14 @@ static int wiimote_hid_probe(struct hid_device *hdev,
 	wdata->battery.type = POWER_SUPPLY_TYPE_BATTERY;
 	wdata->battery.use_for_apm = 0;
 
-	power_supply_powers(&wdata->battery, &hdev->dev);
-
 	ret = power_supply_register(&wdata->hdev->dev, &wdata->battery);
 	if (ret) {
 		hid_err(hdev, "Cannot register battery device\n");
 		goto err_battery;
 	}
 
+	power_supply_powers(&wdata->battery, &hdev->dev);
+
 	ret = wiimote_leds_create(wdata);
 	if (ret)
 		goto err_free;

-- 
Jiri Kosina
SUSE Labs
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ