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-next>] [day] [month] [year] [list]
Message-ID: <ced1eb513cb4134634e89feab0db49ca.squirrel@mungewell.org>
Date:	Tue, 13 Mar 2012 17:08:21 -0400
From:	simon@...gewell.org
To:	"Jiri Kosina" <jkosina@...e.cz>
Cc:	simon@...gewell.org,
	"Mark Brown" <broonie@...nsource.wolfsonmicro.com>,
	linux-input@...r.kernel.org, linux-kernel@...r.kernel.org,
	"Michael Bauer" <michael@...auer.org>,
	"Michal Maly" <madcatxster@...il.com>
Subject: Re: [PATCH 1/2] HID: hid-lg4ff add support for G27 LEDs

> Not really, it's rather simple to use and as Mark said, it's a proper
infrastructure to use here.
> We already have HID drivers which are using this -- you can look at
PicoLCD or Wiimote drivers and you'll see that it's indeed fairly
simple.

So _you_ say.... I'm getting an Oops when device attempts to init the LED
subsytem. :-(
--
Mar 13 12:54:56 ubuntu kernel: [  458.639674] Call Trace:
Mar 13 12:54:56 ubuntu kernel: [  458.641143]  [<c13498ed>] ?
device_create+0x2d/0x30
Mar 13 12:54:56 ubuntu kernel: [  458.641245]  [<c1439119>]
led_classdev_register+0x99/0xf0
Mar 13 12:54:56 ubuntu kernel: [  458.641306]  [<e0977311>]
lg4ff_init+0x2a1/0x570 [hid_logitech]
Mar 13 12:54:56 ubuntu kernel: [  458.641313]  [<e0975427>]
lg_probe+0x147/0x2c0 [hid_logitech]
--

Code snipet below (full file attached):
--
int lg4ff_init(struct hid_device *hid)
{
    struct hid_input *hidinput = list_entry(hid->inputs.next, struct
hid_input, list);
    struct list_head *report_list =
&hid->report_enum[HID_OUTPUT_REPORT].report_list;
    struct input_dev *dev = hidinput->input;
    struct hid_report *report;
    struct hid_field *field;
    struct lg_drv_data *drv_data;
    struct lg4ff_device_entry *entry;
    struct usb_device_descriptor *udesc;
    int error, i, j;
    __u16 bcdDevice, rev_maj, rev_min;
    struct led_classdev *led;
    struct device *dev2 = &dev->dev;
--
    /* register led subsystem - G27 only */
    //if (rev_maj == G27_REV_MAJ && rev_min == G27_REV_MIN) {
    if (rev_maj != G27_REV_MAJ || rev_min != G27_REV_MIN) {
        for (i = 0; i < 5; i++) {
            led = kzalloc(sizeof(struct led_classdev), GFP_KERNEL); if
(!led) {
                dev_err(dev2, "can't allocate memory for LED %d\n", i);
error = -ENOMEM;
                goto err;
            }
            led->name = (void *)(g27_leds[i]);
            led->brightness = 0;
            led->max_brightness = 1;
            led->brightness_get = lg4ff_led_get_brightness;
            led->brightness_set = lg4ff_led_set_brightness;

            entry->led[i] = led;
#if 1
            error = led_classdev_register(dev2, entry->led[i]);
            if (error) {
                dev_err(dev2, "can't register LED %d\n", i);
                goto err;
            }
#endif
        }

        dbg_hid("sysfs interface created for leds\n");
--

Any suggestions as to what I'm doing wrong?
Simon


View attachment "hid-lgff.c" of type "text/x-csrc" (5021 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ