From patchwork Mon Aug 26 07:32:58 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 2849408 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C3FBD9F271 for ; Mon, 26 Aug 2013 07:33:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AB78620211 for ; Mon, 26 Aug 2013 07:33:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 17F082020F for ; Mon, 26 Aug 2013 07:33:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756179Ab3HZHdA (ORCPT ); Mon, 26 Aug 2013 03:33:00 -0400 Received: from mail-bk0-f42.google.com ([209.85.214.42]:41226 "EHLO mail-bk0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755496Ab3HZHc7 (ORCPT ); Mon, 26 Aug 2013 03:32:59 -0400 Received: by mail-bk0-f42.google.com with SMTP id my10so961536bkb.15 for ; Mon, 26 Aug 2013 00:32:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:cc:content-type; bh=zqMXFVxpMOGqVDspHgPYORcVQ5Id2ljzEMEuBRkuyZc=; b=Ypakc91R89rjD4lk2pfJt7UOIjdAhHec9BqHZAVYRapp8U6/mbbGvrHpU1FQuDMUYF uPwD9Zy1uGLXpaaCkPAPnWylT69mQf+EwgflCT59alH8VTLQESa9WRLblOmDN5Z9l5h7 vjkrTt8Bmd2TzJqFWiwnpRoKiuP3JoC9LGqeGf3pixe0XOWy9QViHiAG7YcoxgCzXJVh JdYGmo3qDIT/VWUXOLkbeL80U/tC04anJNNADFO3Y1Js5vcOWA15B9rm9woBXTTgvXmq gAo80eanadF4jv2zlIbV8TJd5SHZ8qtRWy7jsg4jP8PC7oeyYxXzftKuKUsfFP4M7Z0c EWwQ== MIME-Version: 1.0 X-Received: by 10.204.247.71 with SMTP id mb7mr9168119bkb.7.1377502378749; Mon, 26 Aug 2013 00:32:58 -0700 (PDT) Received: by 10.205.13.74 with HTTP; Mon, 26 Aug 2013 00:32:58 -0700 (PDT) Date: Mon, 26 Aug 2013 15:32:58 +0800 Message-ID: Subject: [PATCH] mac80211_hwsim: fix error return code in init_mac80211_hwsim() From: Wei Yongjun To: linville@tuxdriver.com Cc: yongjun_wei@trendmicro.com.cn, linux-wireless@vger.kernel.org Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-9.2 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Wei Yongjun Fix to return -ENOMEM in the netdev alloc error handling case instead of 0, as done elsewhere in this function. Signed-off-by: Wei Yongjun --- drivers/net/wireless/mac80211_hwsim.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c index cb34c78..9e0ebee 100644 --- a/drivers/net/wireless/mac80211_hwsim.c +++ b/drivers/net/wireless/mac80211_hwsim.c @@ -2525,8 +2525,10 @@ static int __init init_mac80211_hwsim(void) } hwsim_mon = alloc_netdev(0, "hwsim%d", hwsim_mon_setup); - if (hwsim_mon == NULL) + if (hwsim_mon == NULL) { + err = -ENOMEM; goto failed; + } rtnl_lock();