From patchwork Thu Jul 15 08:23:10 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 112203 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o6F8P0Pv023980 for ; Thu, 15 Jul 2010 08:25:01 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932694Ab0GOIY6 (ORCPT ); Thu, 15 Jul 2010 04:24:58 -0400 Received: from mail-ew0-f46.google.com ([209.85.215.46]:54833 "EHLO mail-ew0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932676Ab0GOIY4 (ORCPT ); Thu, 15 Jul 2010 04:24:56 -0400 Received: by ewy23 with SMTP id 23so137567ewy.19 for ; Thu, 15 Jul 2010 01:24:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:mime-version:content-type:content-disposition:user-agent; bh=KRP4SAaQky5rE0g491v1Z7fWTw/kR9MWn81B6HUzvJk=; b=LQczhoFZnHlYr/ExeGZyVSlpWYCZsMfVBiot0yG8bNbD75UANCi3tPxeM+rjVgFjU+ 1AYUiI11mXoUxMIMk1Bfke1QtSAOOnVFSt6z6CGxtlkanWhnqQiQBfsPPXY60WMmXxZl So/43ukkFfJ3fjgF4/yCDHRRxupPxYkZAwv3M= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; b=QkD72t8DsfN7vT1lZURzxh9O3vczkxqi1EybeLgVQDUofrXGjMiMVNex0ozdjnlDmc jQ10DdRGsBn+tuJ2pQyDKh9TWjcQYUajcWcFxfLeyyTotzHrwHa45KkYcG9oeR3y5nOU DuE2ge7Zxmord+Z7I1mdIUO43Zfttz87BVjhs= Received: by 10.213.14.20 with SMTP id e20mr2478544eba.21.1279182294783; Thu, 15 Jul 2010 01:24:54 -0700 (PDT) Received: from bicker ([205.177.176.130]) by mx.google.com with ESMTPS id v59sm6094274eeh.4.2010.07.15.01.24.46 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 15 Jul 2010 01:24:54 -0700 (PDT) Date: Thu, 15 Jul 2010 10:23:10 +0200 From: Dan Carpenter To: Pavel Roskin Cc: David Gibson , "John W. Linville" , David Kilroy , linux-wireless@vger.kernel.org, orinoco-devel@lists.sourceforge.net, kernel-janitors@vger.kernel.org Subject: [patch] orinoco_usb: potential null dereference Message-ID: <20100715082309.GE5164@bicker> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Thu, 15 Jul 2010 08:25:01 +0000 (UTC) diff --git a/drivers/net/wireless/orinoco/orinoco_usb.c b/drivers/net/wireless/orinoco/orinoco_usb.c index 78f089b..11d5ec2 100644 --- a/drivers/net/wireless/orinoco/orinoco_usb.c +++ b/drivers/net/wireless/orinoco/orinoco_usb.c @@ -1504,16 +1504,16 @@ static inline void ezusb_delete(struct ezusb_priv *upriv) ezusb_ctx_complete(list_entry(item, struct request_context, list)); - if (upriv->read_urb->status == -EINPROGRESS) + if (upriv->read_urb && upriv->read_urb->status == -EINPROGRESS) printk(KERN_ERR PFX "Some URB in progress\n"); mutex_unlock(&upriv->mtx); - kfree(upriv->read_urb->transfer_buffer); - if (upriv->bap_buf != NULL) - kfree(upriv->bap_buf); - if (upriv->read_urb != NULL) + if (upriv->read_urb) { + kfree(upriv->read_urb->transfer_buffer); usb_free_urb(upriv->read_urb); + } + kfree(upriv->bap_buf); if (upriv->dev) { struct orinoco_private *priv = ndev_priv(upriv->dev); orinoco_if_del(priv);