From patchwork Thu May 12 11:17:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Sakamoto X-Patchwork-Id: 12847593 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7D0A4C433F5 for ; Thu, 12 May 2022 11:19:37 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 76E471AA5; Thu, 12 May 2022 13:18:45 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 76E471AA5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1652354375; bh=jv8G1agcRVwhrz1O1q4Ch+Z472ENfIeo/WXmazNLAX4=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=CqN0iwcZlrSPuib2C7Lj9HLXN9Q1WQz/uA0fg4QXs5+jM8i7l5KMGJmrEf0oT4aHn BYSZ0qecrK6AdzIAuIXzbgux0cylXrtfSu92IOYw2WP4bmqFiM4OkB93QmzAQGPiTi 9u5Ku2gtYNTLODIdVIBaFG2g5BsVjTRcF+4fzZ+w= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id A90E3F80245; Thu, 12 May 2022 13:18:13 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id B042BF804FE; Thu, 12 May 2022 13:18:12 +0200 (CEST) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 05A89F8010B for ; Thu, 12 May 2022 13:18:06 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 05A89F8010B Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b="vPMZ0qLt"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="xf4mG0lp" Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 1F90F5C01B4; Thu, 12 May 2022 07:18:04 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Thu, 12 May 2022 07:18:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakamocchi.jp; h=cc:cc:content-transfer-encoding:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm1; t=1652354284; x= 1652440684; bh=U41sdkndxEPcUW2HyhBS60wraWtLaKd+4y+3d1M8lDk=; b=v PMZ0qLtnKry/pGu8zc6NK4KjTrML9LTCDdfMOzRCCApM47NFSSLxD3WZsm7jacPS /zjGRXjhZ4xSuV+FXJGb5DFU26n3PdDLzmq+nrlaWbJw8ItIoc4LHM9Gt2eoZZ3Y HkjiGLh4EI86KdANWP4AYdpbuWdbuFX9Ohj+L356eFNlrC+dcJQ+lE9JEHNYTIhj FtP3sFs1SgUZ10iuE+RGUHSspM3rkWotEK+105YOUOdSMPINugZ4/oMq+RgPotvb 9DvDq2bfc+cb8kJPhNUgeF/EALzw3phrQJioR0RbBvDhksVuZ3R9tv/R2LB4Yoki /Xg/YO28RauXNGlZxPsHg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1652354284; x=1652440684; bh=U41sdkndxEPcUW2HyhBS60wraWtLaKd+4y+ 3d1M8lDk=; b=xf4mG0lpw+MGNUABxgT/09xcAl9EvWDFQ3YJaImlcUTQop8tvC6 MM1hgOtvR9HmjXpgtBAKI9cWR5w2z49j6WJwMvJkKpamFwuFcGwCt5RbGFdFRHTY CUv7dtcGp8ulSmY4fBoIDGvjyl65lQ8TUeRUHXS5HRfwD99FKcN14zNleCa6Kf7Y rM6F2gs34mhq02VPmh+HTBUSf7Yv25Q88ASOnoM0TrveAmsrnYVtDsk+60KJ0ALC lmJG4FJHm5kqh46soxRvuOzRXA5h8mshFDxFAp5EDKSD3dxlktZM7cpvGdq8qoKz H8d7X5LRoPWJa/r6UUtSJ2Q7EwWB/aQf90g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrgeejgdefiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefvrghkrghs hhhiucfurghkrghmohhtohcuoehoqdhtrghkrghshhhisehsrghkrghmohgttghhihdrjh hpqeenucggtffrrghtthgvrhhnpedvjefgjeeuvdfguddukeelveetgfdtvefhtdfffeei gfevueetffeivdffkedvtdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpehoqdhtrghkrghshhhisehsrghkrghmohgttghhihdrjhhp X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 12 May 2022 07:18:02 -0400 (EDT) From: Takashi Sakamoto To: tiwai@suse.de, stefanr@s5r6.in-berlin.de Subject: [PATCH 1/3] firewire: convert sysfs sprintf/snprintf family to sysfs_emit Date: Thu, 12 May 2022 20:17:54 +0900 Message-Id: <20220512111756.103008-2-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220512111756.103008-1-o-takashi@sakamocchi.jp> References: <20220512111756.103008-1-o-takashi@sakamocchi.jp> MIME-Version: 1.0 Cc: Jiapeng Chong , alsa-devel@alsa-project.org, linux1394-devel@lists.sourceforge.net, Abaci Robot X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: Jiapeng Chong Fix the following coccicheck warning: ./drivers/firewire/core-device.c:375:8-16: WARNING: use scnprintf or sprintf. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Signed-off-by: Takashi Sakamoto --- drivers/firewire/core-device.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/firewire/core-device.c b/drivers/firewire/core-device.c index 90ed8fdaba75..adddd8c45d0c 100644 --- a/drivers/firewire/core-device.c +++ b/drivers/firewire/core-device.c @@ -372,8 +372,7 @@ static ssize_t rom_index_show(struct device *dev, struct fw_device *device = fw_device(dev->parent); struct fw_unit *unit = fw_unit(dev); - return snprintf(buf, PAGE_SIZE, "%d\n", - (int)(unit->directory - device->config_rom)); + return sysfs_emit(buf, "%td\n", unit->directory - device->config_rom); } static struct device_attribute fw_unit_attributes[] = { @@ -403,8 +402,7 @@ static ssize_t guid_show(struct device *dev, int ret; down_read(&fw_device_rwsem); - ret = snprintf(buf, PAGE_SIZE, "0x%08x%08x\n", - device->config_rom[3], device->config_rom[4]); + ret = sysfs_emit(buf, "0x%08x%08x\n", device->config_rom[3], device->config_rom[4]); up_read(&fw_device_rwsem); return ret; From patchwork Thu May 12 11:17:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Sakamoto X-Patchwork-Id: 12847594 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 494A5C433EF for ; Thu, 12 May 2022 11:19:56 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 71CBA1AB2; Thu, 12 May 2022 13:19:04 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 71CBA1AB2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1652354394; bh=NH8yZoAXdtOReiq0YovMMdMQDe8qqy2jbXkwmV+zIM4=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=dclL2d3aeE/QKBp6KEral71gHmRgUsYyZg+QHQ/qn6NwASwUktzwEDFNk4R55VC0y imvubkUEN6lZRVgGPtLdtRftChTDsc4Khc7ii++wn2wg7OCZAwMaDDw7EsZs8gsFeo sFw4V7WOS8822u4JBMrmUkd2c54sFtPcCBkfmTpo= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id A9853F80517; Thu, 12 May 2022 13:18:15 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id EECC8F80510; Thu, 12 May 2022 13:18:14 +0200 (CEST) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id B8395F80154 for ; Thu, 12 May 2022 13:18:07 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz B8395F80154 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b="G2g3f7m6"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="fuM6+MD9" Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 02F105C01D5; Thu, 12 May 2022 07:18:06 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Thu, 12 May 2022 07:18:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakamocchi.jp; h=cc:cc:content-transfer-encoding:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm1; t=1652354285; x= 1652440685; bh=nirK3xVc/Xpd3RXmWv7GnNr+Cb6v4Tn8f6hpEo6+q/Y=; b=G 2g3f7m6h50JCk4Ab9+xqxjNhCOMHa0FNfCrlSSkK/TW5E/l81EtOk+udoqI57HMp cBnRCg9XbHW2ncItQBKyiaEwz2Z7nGc6PZyyjzCyFJNr2952rRmnFgFePSs9rW03 geDiXpITyJNXbZPRzX3dDBo8e4uF3KXGIA9pzbfUe1oL6PLHcvpYZvzn1V9tOBFT LmdBLNBjT2GTOflzJSdbWzw5UhZbNvHwbpcpv3q7Jcg9I4tlEUqtWDpwd8k3r4NE 2iKx/KlY6haj0Wl1AhvM1HCYckgN4PsUriaAOYio7XQCuQjhlIt/uANGAXzXO0hC 00EEyjLQJ+ctwxEzspDNw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1652354285; x=1652440685; bh=nirK3xVc/Xpd3RXmWv7GnNr+Cb6v4Tn8f6h pEo6+q/Y=; b=fuM6+MD9slT261H3zcvBPXydL6GwbbuAdJzXNKjQNYEdT2CpvDo XlwKMSzH3e6DOXbZbCVV1Wyn9q5H0djaG3TZMtHb/oonex24IDttiKizfLPR7Ca6 AJEYgxL4CdXWc5GZFFW8ONKRwaJw64Xm1cklZTnP25tSVMPfj3z+GSax4jE/KqIn 9dlFkW9D4Kvrb1rCO+C8X0mdYJX7lZnWYsvpkWXkAghK2mOEXfEQ0OsiOdBdgKnX DSFgY74Rc1Jq3gbyd/jeF+rGutRVnlt7Nevtwde2Wd49U/WD64VgRZ0QH93bycHd xi/bvS+YXqC2iX2vGQjcsMHtLZ0sTx7T/3g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrgeejgdefiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefvrghkrghs hhhiucfurghkrghmohhtohcuoehoqdhtrghkrghshhhisehsrghkrghmohgttghhihdrjh hpqeenucggtffrrghtthgvrhhnpedvjefgjeeuvdfguddukeelveetgfdtvefhtdfffeei gfevueetffeivdffkedvtdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpehoqdhtrghkrghshhhisehsrghkrghmohgttghhihdrjhhp X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 12 May 2022 07:18:04 -0400 (EDT) From: Takashi Sakamoto To: tiwai@suse.de, stefanr@s5r6.in-berlin.de Subject: [PATCH 2/3] firewire: use struct_size over open coded arithmetic Date: Thu, 12 May 2022 20:17:55 +0900 Message-Id: <20220512111756.103008-3-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220512111756.103008-1-o-takashi@sakamocchi.jp> References: <20220512111756.103008-1-o-takashi@sakamocchi.jp> MIME-Version: 1.0 Cc: alsa-devel@alsa-project.org, linux1394-devel@lists.sourceforge.net, "Minghao Chi \(CGEL ZTE\)" X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: "Minghao Chi (CGEL ZTE)" Replace zero-length array with flexible-array member and make use of the struct_size() helper in kmalloc(). For example: struct fw_request { ... u32 data[]; } Make use of the struct_size() helper instead of an open-coded version in order to avoid any potential type mistakes. Signed-off-by: Minghao Chi (CGEL ZTE) Signed-off-by: Takashi Sakamoto --- drivers/firewire/core-transaction.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/firewire/core-transaction.c b/drivers/firewire/core-transaction.c index e12a0a4c33f7..49657a793e80 100644 --- a/drivers/firewire/core-transaction.c +++ b/drivers/firewire/core-transaction.c @@ -778,7 +778,7 @@ static struct fw_request *allocate_request(struct fw_card *card, return NULL; } - request = kmalloc(sizeof(*request) + length, GFP_ATOMIC); + request = kmalloc(struct_size(request, data, length), GFP_ATOMIC); if (request == NULL) return NULL; From patchwork Thu May 12 11:17:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Sakamoto X-Patchwork-Id: 12847595 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AB6AFC433EF for ; Thu, 12 May 2022 11:20:00 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id BBF2C1ABC; Thu, 12 May 2022 13:19:08 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz BBF2C1ABC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1652354398; bh=KlDPCAy6YEU4yS/gyk2lmB/DLLLtX1ZadcGnjAlqtTA=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=GJIbPpIM7Drpc1Uu8fVfBGkRMd9B+zgBaX7BsbgkFsdJXfCMPWgKDquUZMFILXIKW UloLTp+IywOM2DgDQxK6JphSIgLXML7MFILmuwgZogQypkI35Ididf6gSH4fx+lSu8 SX6tsDrCALqw7Gp0CGKfzvqwUEU1kURAKNBm27XM= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 4F62EF80526; Thu, 12 May 2022 13:18:21 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 0CC65F80527; Thu, 12 May 2022 13:18:20 +0200 (CEST) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 527D9F804FE for ; Thu, 12 May 2022 13:18:09 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 527D9F804FE Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b="DQPBlNLp"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="D7Cfv6Kf" Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 0ABEF5C018E; Thu, 12 May 2022 07:18:08 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Thu, 12 May 2022 07:18:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakamocchi.jp; h=cc:cc:content-transfer-encoding:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm1; t=1652354288; x= 1652440688; bh=H1TGreYI/MRSwNTVTCp09YIeRc7cCCHdO6Rbul0lX/Y=; b=D QPBlNLpgDxcfhzylwnHCISh5Zq26QbXe2toOjAd0AcsEfPyJOVB/19HpbTlH32Q9 eS4c2/WL8ivCYghi48Et6DB8KMbnIGCIgmTUibdfZvQldK3vf68Zh7ZiLXJuA9MV Rqt+4aC8knByDdIPvYC57MdVzHBadvnCg3pNr7Cgf4IaEq5CiGpznCI7X5tUZRNd 4pUMl+DkxIY2vjhBX7J/GZGkaah3W2j5wyvJubR4T3eaP9E8m03Eu2VcUUe5H4VU M8D2imGBqXLANOO6TDRTOiuGM8knX/UNzF4HWEJ/mf/XH9AkSftiH93if8XJvN9n Hfa2KZuw7JNJY1OdSuckg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1652354288; x=1652440688; bh=H1TGreYI/MRSwNTVTCp09YIeRc7cCCHdO6R bul0lX/Y=; b=D7Cfv6KflQpskpctFLaH/da4Yoj1Y7zkLjkIEJBjKHCAcRI7Cvh gsI/PdJDPCaUnVX87lQBawrqzTmxMGRIo0ioSmcXQkSdGy9b58KlE4XQ+bDwXspZ e3ZtBAKNTQjnwNa9BZPhL3rzOfAMiGIvNP5GKJccyLPTv4pcUNEayyldljk9MZzt 0vF024Asc5Ah11lHARBfJ/qLyBbjNEyNASctsQnt8rnKjLeTxgUNEGbpoTW2qibq hZHAeWcG1MXckoomh+gEBvHm2uF2gl+GZMOy3WS3bnx5mFqj7elS3rRKVR8I3DzN frZbvjIicIE+I3g1N4ooTquQ/gVqq0dz3wA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrgeejgdefiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefvrghkrghs hhhiucfurghkrghmohhtohcuoehoqdhtrghkrghshhhisehsrghkrghmohgttghhihdrjh hpqeenucggtffrrghtthgvrhhnpedvjefgjeeuvdfguddukeelveetgfdtvefhtdfffeei gfevueetffeivdffkedvtdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpehoqdhtrghkrghshhhisehsrghkrghmohgttghhihdrjhhp X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 12 May 2022 07:18:06 -0400 (EDT) From: Takashi Sakamoto To: tiwai@suse.de, stefanr@s5r6.in-berlin.de Subject: [PATCH 3/3] firewire: Fix using uninitialized value Date: Thu, 12 May 2022 20:17:56 +0900 Message-Id: <20220512111756.103008-4-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220512111756.103008-1-o-takashi@sakamocchi.jp> References: <20220512111756.103008-1-o-takashi@sakamocchi.jp> MIME-Version: 1.0 Cc: alsa-devel@alsa-project.org, linux1394-devel@lists.sourceforge.net, Lv Ruyi , Zeal Robot X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: Lv Ruyi If data is null, request->data wouldn't be assigned value. It is random value, but we use it in handle_exclusive_region_request() and handle_fcp_region_request() later. Fix the bug by initializing it. (Revised by Takashi Sakamoto to rebase to the previous patch.) Reported-by: Zeal Robot Signed-off-by: Lv Ruyi Signed-off-by: Takashi Sakamoto --- drivers/firewire/core-transaction.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/firewire/core-transaction.c b/drivers/firewire/core-transaction.c index 49657a793e80..d10d890d7d48 100644 --- a/drivers/firewire/core-transaction.c +++ b/drivers/firewire/core-transaction.c @@ -778,7 +778,7 @@ static struct fw_request *allocate_request(struct fw_card *card, return NULL; } - request = kmalloc(struct_size(request, data, length), GFP_ATOMIC); + request = kzalloc(struct_size(request, data, length), GFP_ATOMIC); if (request == NULL) return NULL;