From patchwork Sat Sep 11 15:39:57 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ondrej Zary X-Patchwork-Id: 64524 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id BCC70B6F0E for ; Sun, 12 Sep 2010 01:40:47 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752656Ab0IKPkM (ORCPT ); Sat, 11 Sep 2010 11:40:12 -0400 Received: from mail1-out1.atlantis.sk ([80.94.52.55]:56660 "EHLO mail.atlantis.sk" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752363Ab0IKPkM (ORCPT ); Sat, 11 Sep 2010 11:40:12 -0400 Received: (qmail 21873 invoked from network); 11 Sep 2010 15:40:10 -0000 Received: from unknown (HELO pentium) (rainbow@rainbow-software.org@85.216.180.141) by mail.atlantis.sk with AES256-SHA encrypted SMTP; 11 Sep 2010 15:40:10 -0000 From: Ondrej Zary To: David Miller Subject: [PATCH net-next-2.6] cx82310_eth: check usb_string() return value for error Date: Sat, 11 Sep 2010 17:39:57 +0200 User-Agent: KMail/1.9.10 Cc: netdev@vger.kernel.org, Kernel development list MIME-Version: 1.0 Content-Disposition: inline Message-Id: <201009111740.00243.linux@rainbow-software.org> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Fix that usb_string() return value is not checked for error (negative value). Also change the ignore message a bit and lower its level to info. Signed-off-by: Ondrej Zary --- linux-2.6.36-rc3-/drivers/net/usb/cx82310_eth.c 2010-09-11 17:06:59.000000000 +0200 +++ linux-2.6.36-rc3/drivers/net/usb/cx82310_eth.c 2010-09-11 17:21:22.000000000 +0200 @@ -138,11 +138,9 @@ static int cx82310_bind(struct usbnet *d struct usb_device *udev = dev->udev; /* avoid ADSL modems - continue only if iProduct is "USB NET CARD" */ - if (udev->descriptor.iProduct && - usb_string(udev, udev->descriptor.iProduct, buf, sizeof(buf)) && - strcmp(buf, "USB NET CARD")) { - dev_err(&udev->dev, - "probably an ADSL modem, use cxacru driver instead\n"); + if (usb_string(udev, udev->descriptor.iProduct, buf, sizeof(buf)) > 0 + && strcmp(buf, "USB NET CARD")) { + dev_info(&udev->dev, "ignoring: probably an ADSL modem\n"); return -ENODEV; }