From patchwork Mon Feb 1 12:26:46 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaehyun Lim X-Patchwork-Id: 8178671 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D7492BEEE5 for ; Mon, 1 Feb 2016 12:27:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1D52E203E5 for ; Mon, 1 Feb 2016 12:27:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4270B203C4 for ; Mon, 1 Feb 2016 12:27:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932220AbcBAM1a (ORCPT ); Mon, 1 Feb 2016 07:27:30 -0500 Received: from mail-pf0-f193.google.com ([209.85.192.193]:36378 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932210AbcBAM13 (ORCPT ); Mon, 1 Feb 2016 07:27:29 -0500 Received: by mail-pf0-f193.google.com with SMTP id n128so7472838pfn.3 for ; Mon, 01 Feb 2016 04:27:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ISMSv3AiQ92yBVFiFtXPXBOskNb5fOeGSguRS/GJ40c=; b=rw6tzKv0BlEgK6Xm2kqz9NcYWa7LyR0NaVh2JXFIgjUi0RDYphZePfmmQpOr7JBQTZ ScUkY8dkUmlWkgEWVlGvapQ2WFrMnBCN9WYFb9ovLCDzxWvR+e0pw3pPTnbr8T+TRTum 5q9MimMdwy19KAsyKDYeITI2opKGQTHSU0OOpoIweT9vOcBYDyTVpUAFWu7s+6LwC3fO sWd2RnBSSpm0Bt+8VMFB9Ez3Ky/buEDGQOWkttVj3nCd0+pYT7XOqgL/bPIdHnxyU24Q DjiLlUCRJtvxAPZxheBfyjl4xliRp6GjjhLWJb5HPdxJjX+QlIrSPgxoXMioAYEXHAgJ ejpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ISMSv3AiQ92yBVFiFtXPXBOskNb5fOeGSguRS/GJ40c=; b=II+mc/T5B4x2/DYT6LmSw9iOEBctye5FbJhGgZ71octT5G/SLYEKlj70yJOVQI7DaA x5qrUJ3ni2e/6F5W2USmJKCRLe458Ctg0mx5yN0i3RSwOR8Lp3DsBQGuwYIkJDOLAlkf VbAMquyM2KngSpkJptbjcTHBk8OKYX66aOXXEqbil/Q65v62u9xsdIzZIh0b2u4yGYp1 D9Qe5+U0RqEQMN8/uIQr6JArS5fDdjQZZRB4Rx1Frb2/kWGh3zG+aMnEDW49LvULDHfk MbmSfLYjBYpoIAfd7N2RUMhNq3ad1Jxl/NmQr9hbF+GEv/iX9deR/aa75gY4b3apx87t hK/Q== X-Gm-Message-State: AG10YOSFDQR7GrHg/Clb2NjXHbsmpMkxlC872Omzq4cCV9ZIvxRDCUau0JifqQUjqAwsDQ== X-Received: by 10.98.44.66 with SMTP id s63mr38081380pfs.2.1454329648659; Mon, 01 Feb 2016 04:27:28 -0800 (PST) Received: from localhost.localdomain ([218.233.16.2]) by smtp.gmail.com with ESMTPSA id y86sm42992851pfa.26.2016.02.01.04.27.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 01 Feb 2016 04:27:28 -0800 (PST) From: Chaehyun Lim To: gregkh@linuxfoundation.org Cc: johnny.kim@atmel.com, austin.shin@atmel.com, chris.park@atmel.com, tony.cho@atmel.com, glen.lee@atmel.com, leo.kim@atmel.com, linux-wireless@vger.kernel.org, devel@driverdev.osuosl.org, Chaehyun Lim Subject: [PATCH 10/11] staging: wilc1000: linux_mon: fix error code of kmalloc Date: Mon, 1 Feb 2016 21:26:46 +0900 Message-Id: <1454329607-9486-10-git-send-email-chaehyun.lim@gmail.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1454329607-9486-1-git-send-email-chaehyun.lim@gmail.com> References: <1454329607-9486-1-git-send-email-chaehyun.lim@gmail.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,RCVD_IN_BRBL_LASTEXT,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 This patch fixes error codes as -ENOMEM instead of using -EFAULT if kmalloc is failed. Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/linux_mon.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/wilc1000/linux_mon.c b/drivers/staging/wilc1000/linux_mon.c index a19755e..1443a23 100644 --- a/drivers/staging/wilc1000/linux_mon.c +++ b/drivers/staging/wilc1000/linux_mon.c @@ -166,14 +166,14 @@ static int mon_mgmt_tx(struct net_device *dev, const u8 *buf, size_t len) mgmt_tx = kmalloc(sizeof(*mgmt_tx), GFP_ATOMIC); if (!mgmt_tx) { PRINT_ER("Failed to allocate memory for mgmt_tx structure\n"); - return -EFAULT; + return -ENOMEM; } mgmt_tx->buff = kmalloc(len, GFP_ATOMIC); if (!mgmt_tx->buff) { PRINT_ER("Failed to allocate memory for mgmt_tx buff\n"); kfree(mgmt_tx); - return -EFAULT; + return -ENOMEM; } mgmt_tx->size = len;