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] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 24 Nov 2009 15:11:28 +0000
From:	Steve.Glendinning@...c.com
To:	Oliver Neukum <oliver@...kum.org>
Cc:	"David S. Miller" <davem@...emloft.net>,
	David Brownell <david-b@...bell.net>,
	linux-usb@...r.kernel.org, netdev@...r.kernel.org,
	stern@...land.harvard.edu,
	"Torgny Johansson" <torgny.johansson@...csson.com>
Subject: Re: [patch]USB autosuspend for cdc-ether

Hi Oliver,

Interesting patch, I'm going to try and add support for this
to smsc95xx.

A few things I noticed:

> @@ -929,7 +961,11 @@ kevent (struct work_struct *work)
>        int         retval = 0;
> 
>        clear_bit (EVENT_LINK_RESET, &dev->flags);
> +      status = usb_autopm_get_interface(dev->intf);
> +      if (status < 0)
> +         goto skip_reset;
>        if(info->link_reset && (retval = info->link_reset(dev)) < 0) {
> +skip_reset:
>           devinfo(dev, "link reset failed (%d) usbnet usb-%s-%s, %s",
>              retval,
>              dev->udev->bus->bus_name, dev->udev->devpath,

on EVENT_LINK_RESET you call usb_autopm_get_interface with no matching
usb_autopm_put_interface, so you leak 1 reference count and the device
never autosuspends.

> @@ -958,7 +994,7 @@ static void tx_complete (struct urb *urb)
> 
>        switch (urb->status) {
>        case -EPIPE:
> -         usbnet_defer_kevent (dev, EVENT_TX_HALT);
> +         usbnet_defer_kevent (dev, EVENT_TX_HALT); 
>           break;
> 
>        /* software-driven interface shutdown */

The only change here is the addition of trailing whitespace (which both
checkpatch.pl and git complain about).  You should run your patch through
scripts/checkpatch.pl and fix these up.

--
Steve
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ