Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp94690ybz; Tue, 21 Apr 2020 05:26:09 -0700 (PDT) X-Google-Smtp-Source: APiQypIB0tF9VUWvEvOHYP3Kd/nbU8GwZWTjgK8CONFT1/GND2VQc1tj9CDIYH/S9Q3teNYOw1np X-Received: by 2002:a17:906:4406:: with SMTP id x6mr21406662ejo.160.1587471969745; Tue, 21 Apr 2020 05:26:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587471969; cv=none; d=google.com; s=arc-20160816; b=PvJKWdffIh8cPvQxUpmM/xqsKxKZNQ1SyZKlmHZoGQxZ3QRhoDFe1JhkTo/fc2vUIZ lBVZ2LV+g+qqkAA6eeH49s+C/BDtdFV3JVhaUH9v7QUgfdioZaPjrtGgphh2uviMLd/A 5Eq/8rLzBgxfe3aSV3gF6OP/xS+0gs3Fvux6xqT+sJJK8DJULcGSJJHOPQA1IxWSilIy k+KhjqRCmzVXKtOR84Fn5HQh9Qe/SpAQJUx9QJYtyRA1esthsZ1S+btSAqQ8DxDgqiZi noLoSpRWLZv1es8Q9ZMySl9/5w/YgAagpZZJfaAYcTfPSo8163/v2MtUodmQDjhBCpSV pieg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=ZMuu6jr67mWDC+2vChlDZVBIQ6qCpIEXFOkwlQjM7IM=; b=zbKHI7UUCgxD0NMbpjEMVYynvoD8EJ/sScrrZaQPxC0IUDLaEZVy1Z/rVGDHMrn7tE lve+zfAhtkirfgWvhVLPxCs1LWxrKlZSnfw1YaWUD1jXIE2OtdbmsCIdF5iOkGBZIS76 enXNpLN3iNs13QZ2rf3Re15mOVobHthely79OIBq6vBcbwQQ5EQoMyiXEHdDGmHr+0VI Z8Q+PeBFHW8Jrc4a/Q3Ph1TzYk8XlVIwmy+iNIdFmh9jgCejVhHAn37jZCOaX+JcBmkm NnnWB0Y2Zd+Ei69Js77HKeuJNe/dJ+zTW4B4zvFAl0+wx2P+lPYjESuG8ZxUblUNHQeG LsfA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c17si1504405edt.167.2020.04.21.05.25.46; Tue, 21 Apr 2020 05:26:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728741AbgDUMX6 (ORCPT + 99 others); Tue, 21 Apr 2020 08:23:58 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:48588 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728391AbgDUMX6 (ORCPT ); Tue, 21 Apr 2020 08:23:58 -0400 Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 62CB9E3A20F88D91D6E8; Tue, 21 Apr 2020 20:23:56 +0800 (CST) Received: from linux-lmwb.huawei.com (10.175.103.112) by DGGEMS401-HUB.china.huawei.com (10.3.19.201) with Microsoft SMTP Server id 14.3.487.0; Tue, 21 Apr 2020 20:23:47 +0800 From: Zou Wei To: , , , , CC: Zou Wei Subject: [PATCH -next] scsi: aic7xxx: fix kzalloc-simple.cocci warnings Date: Tue, 21 Apr 2020 20:30:07 +0800 Message-ID: <1587472207-105095-1-git-send-email-zou_wei@huawei.com> X-Mailer: git-send-email 2.6.2 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.103.112] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch fixes below warning reported by coccicheck drivers/scsi/aic7xxx/aic7xxx_core.c:4387:7-14: WARNING: kzalloc should be used for ahc, instead of kmalloc/memset Fixes: 48813cf989eb ("[SCSI] aic7xxx: Remove OS utility wrappers") Reported-by: Hulk Robot Signed-off-by: Zou Wei --- drivers/scsi/aic7xxx/aic7xxx_core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/scsi/aic7xxx/aic7xxx_core.c b/drivers/scsi/aic7xxx/aic7xxx_core.c index 84fc499..999de19 100644 --- a/drivers/scsi/aic7xxx/aic7xxx_core.c +++ b/drivers/scsi/aic7xxx/aic7xxx_core.c @@ -4384,13 +4384,12 @@ ahc_alloc(void *platform_arg, char *name) struct ahc_softc *ahc; int i; - ahc = kmalloc(sizeof(*ahc), GFP_ATOMIC); + ahc = kzalloc(sizeof(*ahc), GFP_ATOMIC); if (!ahc) { printk("aic7xxx: cannot malloc softc!\n"); kfree(name); return NULL; } - memset(ahc, 0, sizeof(*ahc)); ahc->seep_config = kmalloc(sizeof(*ahc->seep_config), GFP_ATOMIC); if (ahc->seep_config == NULL) { kfree(ahc); -- 2.6.2