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:	Wed, 31 Mar 2010 15:10:52 -0700 (PDT)
From:	Daniel Borca <dborca@...oo.com>
To:	Oliver Neukum <oliver@...kum.org>
Cc:	L. Alberto Giménez <agimenez@...valve.es>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
	"linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
	"linville@...driver.com" <linville@...driver.com>,
	"j.dumon@...ion.com" <j.dumon@...ion.com>,
	"steve.glendinning@...c.com" <steve.glendinning@...c.com>,
	"davem@...emloft.net" <davem@...emloft.net>,
	"gregkh@...e.de" <gregkh@...e.de>,
	"dgiagio@...il.com" <dgiagio@...il.com>
Subject: Re: [PATCHv3] drivers/net/usb: Add new driver ipheth

Hello,

Thanks for the comments.  I've already fixed a few things.  We'll fix the remaining ones (below) ASAP.  

Regards,
Daniel Borca

On 31.03.2010, at 23:33, Oliver Neukum <oliver@...kum.org> wrote:

Am Mittwoch, 31. März 2010 21:42:07 schrieb L. Alberto Giménez:

Hi,

a few comments below.

   Regards
       Oliver

+
+static int ipheth_open(struct net_device *net)
+{
+    struct ipheth_device *dev = netdev_priv(net);
+    struct usb_device *udev = dev->udev;
+    int retval = 0;
+
+    usb_set_interface(udev, IPHETH_INTFNUM, IPHETH_ALT_INTFNUM);
+    usb_clear_halt(udev, usb_rcvbulkpipe(udev, dev->bulk_in));
+    usb_clear_halt(udev, usb_sndbulkpipe(udev, dev->bulk_out));

Is this really needed? If so, please add a comment.

+
+    retval = ipheth_carrier_set(dev);
+    if (retval)
+        goto error;
+
+    retval = ipheth_rx_submit(dev, GFP_KERNEL);
+    if (retval)
+        goto error;
+
+    schedule_delayed_work(&dev->carrier_work, IPHETH_CARRIER_CHECK_TIMEOUT);

Does it make sense to start rx while you have no carrier?

+static int ipheth_tx(struct sk_buff *skb, struct net_device *net)
+{
+    struct ipheth_device *dev = netdev_priv(net);
+    struct usb_device *udev = dev->udev;
+    int retval;
+
+    /* Paranoid */
+    if (skb->len > IPHETH_BUF_SIZE) {
+        err("%s: skb too large: %d bytes", __func__, skb->len);
+        dev->stats.tx_dropped++;
+        dev_kfree_skb_irq(skb);
+        goto exit;
+    }
+
+    memset(dev->tx_buf, 0, IPHETH_BUF_SIZE);
+    memcpy(dev->tx_buf, skb->data, skb->len);

a bit wasteful

+static void ipheth_disconnect(struct usb_interface *intf)
+{
+    struct ipheth_device *dev;
+
+    dev = usb_get_intfdata(intf);
+    if (dev != NULL) {

is this check needed?

+static struct usb_driver ipheth_driver = {
+    .name =        "ipheth",
+    .probe =    ipheth_probe,
+    .disconnect =    ipheth_disconnect,
+    .id_table =    ipheth_table,
+    .supports_autosuspend = 0,

redundant



      

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