Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1646698imm; Wed, 1 Aug 2018 21:24:32 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdJkwfzq/Aa/vw/+00xSmk00Vs1AY8i2sm391ifquHOKeM8NSzF0bpEb+fyOA+Qo+98MpcS X-Received: by 2002:a63:6604:: with SMTP id a4-v6mr1100949pgc.404.1533183872569; Wed, 01 Aug 2018 21:24:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533183872; cv=none; d=google.com; s=arc-20160816; b=WdO7yk6aHV/bDhJERw4X8HZ5c5x5NLgVAv2Mep4PfBv4ngtOW4wO9QosiT1sJks+mP HhxhNVWeQwPNDtf+Y2Y7An01CkMJrhhRa7bBwAT4XzOVaEgszrFuXgL0PjHDbeTV6IZm 7CDQ5esYaKYfB7KWSXfsL71zS2GIUh2tdkGQsefMIc21ANGzqA7aycNEiWd04zf+Cfd4 AM5jvbC6tZ1OeyyPKIBfQcxz4INsRlMSYcyqNc5iMgH0bzy0aH99+NhszEeg7dSRBMx7 NmLvTATCANcKUvypbbtaTNfqFoGi4rzNIrHzYc2rBM1rjtxrzXgj+7Wipof+nGRjtPAe EcEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:arc-authentication-results; bh=fugObW271sGiTIlOkFd9ypVNGqiz2RTaxXirU9aNDXY=; b=I9zC14CVfi2cqqqbFIdXFZ12wio2NnNZcIyy5Y1m8Dy/U2YJw2B1kc9kVwYSK4VZk3 85EuYZCbUGlFDMpFXa21lF9WcNQ1HXh9wxAyFBOCM4iMRm3+YBisSiNglLDy14apgHqN G2+DuqK9xocm1AazMay8VJtSGwRlj9T77oFovWbASlVrDDaZSkMByJf0rsyz+ZYMmN+e Iq87wTIMPu16433I2LvbcaKNB1RfdZ54XCpe3911deHHPgoA9VMd9cVNyanrBnZPzWmD FiTkOjo773Tx7eOJFXekssuqxSBFce9hDXSQhh6Ltr2v2rayAIf2n0tnoU/GQ3JnKfwp K7TQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b1-v6si691648pli.54.2018.08.01.21.24.16; Wed, 01 Aug 2018 21:24:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726099AbeHBGMi (ORCPT + 99 others); Thu, 2 Aug 2018 02:12:38 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:36745 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725765AbeHBGMi (ORCPT ); Thu, 2 Aug 2018 02:12:38 -0400 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id E9DECC2BB1C84; Thu, 2 Aug 2018 12:23:21 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.399.0; Thu, 2 Aug 2018 12:23:15 +0800 From: Wei Yongjun To: Jaroslav Kysela , Takashi Iwai , "Markus Elfring" , Ruslan Bilovol , Jorge Sanjuan , Michael Drake , Greg Kroah-Hartman CC: Wei Yongjun , , , Subject: [PATCH -next] ALSA: usb-audio: Fix invalid use of sizeof in parse_uac_endpoint_attributes() Date: Thu, 2 Aug 2018 04:31:02 +0000 Message-ID: <1533184262-148619-1-git-send-email-weiyongjun1@huawei.com> X-Mailer: git-send-email 1.8.3.1 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 X-Originating-IP: [10.175.113.25] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org sizeof() when applied to a pointer typed expression gives the size of the pointer, not that of the pointed data. Fixes: 7edf3b5e6a45 ("ALSA: usb-audio: AudioStreaming Power Domain parsing") Signed-off-by: Wei Yongjun --- sound/usb/stream.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/usb/stream.c b/sound/usb/stream.c index 8fe3b0e..67cf849 100644 --- a/sound/usb/stream.c +++ b/sound/usb/stream.c @@ -1037,7 +1037,7 @@ static int parse_uac_endpoint_attributes(struct snd_usb_audio *chip, fp->rate_max = UAC3_BADD_SAMPLING_RATE; fp->rates = SNDRV_PCM_RATE_CONTINUOUS; - pd = kzalloc(sizeof(pd), GFP_KERNEL); + pd = kzalloc(sizeof(*pd), GFP_KERNEL); if (!pd) { kfree(fp->rate_table); kfree(fp);