From patchwork Mon Sep 7 15:36:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaehyun Lim X-Patchwork-Id: 7136551 X-Patchwork-Delegate: kvalo@adurom.com 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 899999F1D5 for ; Mon, 7 Sep 2015 15:37:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8423920776 for ; Mon, 7 Sep 2015 15:36:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BA97920680 for ; Mon, 7 Sep 2015 15:36:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753797AbbIGPgy (ORCPT ); Mon, 7 Sep 2015 11:36:54 -0400 Received: from mail-pa0-f50.google.com ([209.85.220.50]:35812 "EHLO mail-pa0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753786AbbIGPgv (ORCPT ); Mon, 7 Sep 2015 11:36:51 -0400 Received: by pacfv12 with SMTP id fv12so102006993pac.2 for ; Mon, 07 Sep 2015 08:36:50 -0700 (PDT) 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=Au/oli5CALLHTnVl7txpiRGMwSvrQM1l16xsSyDWkyk=; b=qmEo93b9xLDiALWdN0+9oJ8GQC1mlyUgAUSbS48O6gXoxHuwByReWDk/v8sm4Jdt6r V8FPn24m2McS/dd7UVaql/AHHfK/aM9Oa/CsnBIIWGYh8TLL+/G7gmBuorhL/79vrh0K jtfAJehBXirTVtR8tD/YTKsZx85elVyr4AoOMup792lvJKroEi7Lg+11acf81g8h1nul Ks4jNHA5YeAK8vYzLSAi3UgAL0z8ph4rRIcdgTSA+oRp8WoxCsGKoJEXMRJZBTf3Or1r J1i19XrqUu81jrH5K9esyLTS7XExkAy+LZlVlQ9FEAuqSFXt80yWVZkuSFAMzshFbhzc 4B3A== X-Received: by 10.68.93.133 with SMTP id cu5mr47438560pbb.71.1441640210759; Mon, 07 Sep 2015 08:36:50 -0700 (PDT) Received: from localhost.localdomain ([218.233.16.2]) by smtp.gmail.com with ESMTPSA id fj4sm207201pdb.23.2015.09.07.08.36.48 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 07 Sep 2015 08:36:50 -0700 (PDT) From: Chaehyun Lim To: gregkh@linuxfoundation.org Cc: johnny.kim@atmel.com, rachel.kim@atmel.com, chris.park@atmel.com, devel@driverdev.osuosl.org, linux-wireless@vger.kernel.org, Chaehyun Lim Subject: [PATCH 2/5] staging: wilc1000: linux_wlan.c: add kzalloc error check Date: Tue, 8 Sep 2015 00:36:36 +0900 Message-Id: <1441640199-1507-2-git-send-email-chaehyun.lim@gmail.com> X-Mailer: git-send-email 2.5.1 In-Reply-To: <1441640199-1507-1-git-send-email-chaehyun.lim@gmail.com> References: <1441640199-1507-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=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, 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 adds error check if kzalloc is failed. Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/linux_wlan.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c index f7dda75..76c48a4 100644 --- a/drivers/staging/wilc1000/linux_wlan.c +++ b/drivers/staging/wilc1000/linux_wlan.c @@ -2270,6 +2270,8 @@ int wilc_netdev_init(void) /*create the common structure*/ g_linux_wlan = kzalloc(sizeof(linux_wlan_t), GFP_KERNEL); + if (!g_linux_wlan) + return -ENOMEM; /*Reset interrupt count debug*/ int_rcvdU = 0;