Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752854AbcLES15 (ORCPT ); Mon, 5 Dec 2016 13:27:57 -0500 Received: from shards.monkeyblade.net ([184.105.139.130]:47522 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752186AbcLES1v (ORCPT ); Mon, 5 Dec 2016 13:27:51 -0500 Date: Mon, 05 Dec 2016 13:27:48 -0500 (EST) Message-Id: <20161205.132748.1851184102764779599.davem@davemloft.net> To: bianpan2016@163.com Cc: woojung.huh@microchip.com, UNGLinuxDriver@microchip.com, netdev@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/1] net: usb: set error code when usb_alloc_urb fails From: David Miller In-Reply-To: <1480764288-5448-1-git-send-email-bianpan2016@163.com> References: <1480764288-5448-1-git-send-email-bianpan2016@163.com> X-Mailer: Mew version 6.7 on Emacs 24.5 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Mon, 05 Dec 2016 09:28:28 -0800 (PST) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 545 Lines: 14 From: Pan Bian Date: Sat, 3 Dec 2016 19:24:48 +0800 > In function lan78xx_probe(), variable ret takes the errno code on > failures. However, when the call to usb_alloc_urb() fails, its value > will keeps 0. 0 indicates success in the context, which is inconsistent > with the execution result. This patch fixes the bug, assigning > "-ENOMEM" to ret when usb_alloc_urb() returns a NULL pointer. > > Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=188771 > > Signed-off-by: Pan Bian Applied.