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>] [day] [month] [year] [list]
Date:	Mon, 03 Mar 2008 23:10:16 +0100
From:	"Alfred E. Heggestad" <aeh@...org>
To:	Oliver Neukum <oliver@...kum.org>
CC:	dmitry.torokhov@...il.com, linux-input@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] input: driver for USB VoIP phones with CM109 chipset

Oliver Neukum wrote:
> Am Donnerstag, 7. Februar 2008 19:38:10 schrieb Alfred E. Heggestad:
>> +static void buzz(struct cm109_dev *dev, int on)
>> +{
>> +       int ret;
>> +
>> +       if (dev == NULL) {
>> +               err("buzz: dev is NULL");
>> +               return;
>> +       }
>> +
>> +       dbg("Buzzer %s", on ? "on" : "off");
>> +       if (on)
>> +               dev->ctl_data->byte[HID_OR0] |= BUZZER_ON;
>> +       else
>> +               dev->ctl_data->byte[HID_OR0] &= ~BUZZER_ON;
>> +
>> +       ret = usb_submit_urb(dev->urb_ctl, GFP_ATOMIC);
>> +       if (ret)
>> +               err("%s - usb_submit_urb failed %d", __FUNCTION__, ret);
>> +}
>> +
>> +static int input_ev(struct input_dev *idev, unsigned int type,
>> +                   unsigned int code, int value)
>> +{
>> +       struct cm109_dev *dev = input_get_drvdata(idev);
>> +       unsigned long flags;
>> +
>> +#ifdef CM109_DEBUG
>> +       info("input_ev: type=%u code=%u value=%d", type, code, value);
>> +#endif
>> +
>> +       if (type != EV_SND)
>> +               return -EINVAL;
>> +
>> +       switch (code) {
>> +       case SND_TONE:
>> +       case SND_BELL:
>> +               break;
>> +       default:
>> +               return -EINVAL;
>> +       }
>> +
>> +       spin_lock_irqsave(&cm109_buzz_lock, flags);
>> +       buzz(dev, value);
>> +       spin_unlock_irqrestore(&cm109_buzz_lock, flags);
>> +
>> +       return 0;
>> +}
> 
> What makes you sure you finished the URB to switch the buzzer on before
> you try to switch it off again? It seems that you might be attempting to
> manipulate a live URB there if you hit the window.
> 

thanks for the hint. could you let me know how I can fix this properly,
or point me to some USB driver code that implements this correctly.. ?


/alfred

> 	Regards
> 		Oliver

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