From mboxrd@z Thu Jan 1 00:00:00 1970 From: Helmut Raiger Date: Mon, 04 Jul 2011 11:41:45 +0200 Subject: [U-Boot] [PATCH RFC] smc911x: enable mii commands In-Reply-To: References: <4E0C80AF.7040707@comelit.it> Message-ID: <4E118AD9.9000200@hale.at> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 06/30/2011 04:02 PM, Luca Ceresoli wrote: > +static int smc911x_miiphy_read_byname(char *devname, unsigned char addr, > + unsigned char reg, unsigned short *value) > +{ > + struct eth_device *dev; > + > + if (devname == NULL) > + return -1; > + > + dev = eth_get_dev_by_name(devname); You're right. eth_get_dev_by_name() is not safe for devname == NULL as it uses strcmp(). Best would be to fix this there, I'll adjust my patch accordingly. > + > + if (dev == NULL) { > + printf(DRIVERNAME ": device %s not found\n", devname); > + return -1; > + } None of the other drivers in drivers/net add this kind of verbosity, so I tend to leave it at that. Helmut -- Scanned by MailScanner.