[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <471CF893.3050605@ru.mvista.com>
Date: Mon, 22 Oct 2007 23:22:59 +0400
From: Valentine Barshak <vbarshak@...mvista.com>
To: Oliver Neukum <oliver@...kum.org>
Cc: linux-usb-devel@...ts.sourceforge.net, netdev@...r.kernel.org
Subject: Re: [linux-usb-devel] [PATCH] USB: net: Fix asix read transfer buffer
allocations.
Oliver Neukum wrote:
> Am Montag 22 Oktober 2007 schrieb Valentine Barshak:
>> static int asix_mdio_read(struct net_device *netdev, int phy_id, int loc)
>> {
>> struct usbnet *dev = netdev_priv(netdev);
>> + void *buf;
>> u16 res;
>>
>> mutex_lock(&dev->phy_mutex);
>> asix_set_sw_mii(dev);
>> +
>> + buf = kmalloc(2, GFP_KERNEL);
>
> This is done under lock. Can you allocate the buffer once and reuse it?
>
> Regards
> Oliver
>
I think we can use 2 bytes of the usbnet data buffer for this.
I'll submit a new patch soon.
Thanks,
Valentine.
-
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