From patchwork Tue Jul 14 01:48:40 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Chaehyun Lim X-Patchwork-Id: 6783261 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 33CFB9F2E8 for ; Tue, 14 Jul 2015 01:49:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 585142064B for ; Tue, 14 Jul 2015 01:49:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 699C22063E for ; Tue, 14 Jul 2015 01:49:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752630AbbGNBtA (ORCPT ); Mon, 13 Jul 2015 21:49:00 -0400 Received: from mail-pa0-f66.google.com ([209.85.220.66]:34562 "EHLO mail-pa0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751767AbbGNBs7 (ORCPT ); Mon, 13 Jul 2015 21:48:59 -0400 Received: by pactm7 with SMTP id tm7so29095208pac.1 for ; Mon, 13 Jul 2015 18:48:59 -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:mime-version:content-type :content-transfer-encoding; bh=o9soCmuz5dCMJREgAY5YHsitBY5cUsXnVaFRmAhgm60=; b=TOzpOgf3dWTKW4ny2ISuag5ImPW41c0tZu/Z+6cpl7ZpIYT38+3kLkkLM2qWQM87Rm bomzuiRwXF4Zy9gYz5UGW+ACTNzCJPSb/FubgF8GI7ciHQasaBBfJuJwEPJ5oGFHvZh1 LkXtDy8u0/xWumIYynLPXq+bQxG5W2djh2czC/Kyz0RU/2/wvS4GGNTp2RB7ZHb8wKrj t3Jnl1kIfWq255Uz5N6memyGD063N+JCJhyEKx/XfOiUHU8ZyUsTUpx+LoEn4LWv2tzb JhTe77gcRgrR/tH8fBPj3eDKYj8oEhw0xZPEp537Q/3Y6deOLUiigTaiISvGzuh0tDEo 94bg== X-Received: by 10.68.235.38 with SMTP id uj6mr75242021pbc.57.1436838539070; Mon, 13 Jul 2015 18:48:59 -0700 (PDT) Received: from localhost.localdomain ([218.233.16.2]) by smtp.gmail.com with ESMTPSA id he9sm19858713pbc.7.2015.07.13.18.48.55 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 13 Jul 2015 18:48:58 -0700 (PDT) From: Chaehyun Lim To: gregkh@linuxfoundation.org Cc: johnny.kim@atmel.com, rachel.kim@atmel.com, dean.lee@atmel.com, chris.park@atmel.com, linux-wireless@vger.kernel.org, devel@driverdev.osuosl.org, Chaehyun Lim Subject: [PATCH 1/2] staging: wilc1000: fix uninitialized variablie warning Date: Tue, 14 Jul 2015 10:48:40 +0900 Message-Id: <1436838521-8200-1-git-send-email-chaehyun.lim@gmail.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-8.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 When building this driver, I got a warning as below: host_interface.c: In function ‘host_int_add_beacon’: host_interface.c:7116:16: warning: ‘*((void *)&strHostIFmsg+8).pu8Head’ may be used uninitialized in this function [-Wmaybe-uninitialized] Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/host_interface.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index c089e73..ca97b70 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -7131,8 +7131,11 @@ s32 host_int_add_beacon(WILC_WFIDrvHandle hWFIDrv, u32 u32Interval, pstrSetBeaconParam->u32DTIMPeriod = u32DTIMPeriod; pstrSetBeaconParam->u32HeadLen = u32HeadLen; pstrSetBeaconParam->pu8Head = (u8 *)WILC_MALLOC(u32HeadLen); - if (pstrSetBeaconParam->pu8Head == NULL) - WILC_ERRORREPORT(s32Error, WILC_NO_MEM); + if (pstrSetBeaconParam->pu8Head == NULL) { + PRINT_ER("Failed to allocated memory\n"); + s32Error = WILC_NO_MEM; + goto _fail_; + } WILC_memcpy(pstrSetBeaconParam->pu8Head, pu8Head, u32HeadLen); pstrSetBeaconParam->u32TailLen = u32TailLen; @@ -7159,6 +7162,7 @@ s32 host_int_add_beacon(WILC_WFIDrvHandle hWFIDrv, u32 u32Interval, WILC_FREE(pstrSetBeaconParam->pu8Tail); } +_fail_: return s32Error; }