Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9127730pxu; Mon, 28 Dec 2020 07:17:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJx/8iUazuGW4RWA9tWD/U2eqYiyhiksdc+Jivwu1FqgKx19oow5o28vT6hxZMqtyATYgaRe X-Received: by 2002:aa7:c886:: with SMTP id p6mr43540890eds.352.1609168670205; Mon, 28 Dec 2020 07:17:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609168670; cv=none; d=google.com; s=arc-20160816; b=Ol6kO5GQe/VZrgsJRepIDJVuo4ec5qOL5wakn4hEMy8OTbozmQnG31Pe8pP0gT6D7Q 69t2stYK0hQJZXlJvtcteJf2OvSaT+zgR8a6hlQOsUnVT9T3G2/lYiIEXkHf3Z/+AN/V /xZbWpshQJ4vj7Mn3gVl9qGVENE+EENyNExc2qFq15hXxdwupfMgIAHNM93gWBH+9qP9 4aYd/sbdlu6oVwwsjz2PUTfz2KD5dbSnFN5W8jFYHF9jNkFqZSB6n4q4ZyjrJXq7q4b1 YyA4Sx/CJTcQ92TEs2R1K800w+h+j1zR4cYlgImmxK8+X3kuQuy72QqiKKI7xlltE99j ECZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=hcMyWo2u6oOdBhHm5MKGeP58MvJ3H6f5U1L5y4St528=; b=aco8i1DIPD6dHkeJcNj5YUBuvLnGVgLKzfdEkhbQwBDAeBArE7CRgVOUVdQA8IUvh+ rXxgAZP29G+Kh3Z5fIOVJchciwSd9/cZy2ZQ4D7rhAc0DCUb/GXbHnsAqQrKXQpj8Ue5 X38TKqLbPoYZT2BVV0hmeHMyJTzhJNTpTSeEH/eTuXkq5G+/OrFgkHD+E6366h6JYXlb 2uomsOPAH29Ioc0uaejev115cWTI/CCHE/KZhXD16oF9mH1Bhxl0DMcpQTRYVxmb58HO EbqnuILNFwTu5/3PB+7yFuyFbNrmtZjA1BoBkaLYMg3XJecT3Cgh/kDxfZkJsbwVC2/r xD6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=c2NdVei+; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id zh12si18707002ejb.148.2020.12.28.07.17.27; Mon, 28 Dec 2020 07:17:50 -0800 (PST) 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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=c2NdVei+; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2437436AbgL1OEm (ORCPT + 99 others); Mon, 28 Dec 2020 09:04:42 -0500 Received: from mail.kernel.org ([198.145.29.99]:38474 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2437382AbgL1OEf (ORCPT ); Mon, 28 Dec 2020 09:04:35 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id DAFC7206D4; Mon, 28 Dec 2020 14:04:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609164259; bh=3vucih4tF+dWL/5eSd/msFD16XeurQkjRefXMhHHfuc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=c2NdVei+QKYcUyNKn3x2nv94gE3dEGHmZWNHAivkGZeMm4laSZvBjgY+97TsrQ6rM eBM6NDrn7kIa0CEm4+uFd1aPzc9vkenIm58yAQvatbg0bTwl0anawCFdmkfHJpdyRO ndCNxCf4mvZtwsuBRIU93QHYQWOkzkfnEtCuIVb8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Colin Ian King , Hans Verkuil , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 5.10 118/717] media: tm6000: Fix sizeof() mismatches Date: Mon, 28 Dec 2020 13:41:56 +0100 Message-Id: <20201228125026.614861728@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Colin Ian King [ Upstream commit a08ad6339e0441ca12533969ed94a87e3655426e ] The are two instances of sizeof() being used incorrectly. The sizeof(void *) is incorrect because urb_buffer is a char ** pointer, fix this by using sizeof(*dev->urb_buffer). The sizeof(dma_addr_t *) is incorrect, it should be sizeof(*dev->urb_dma), which is a dma_addr_t and not a dma_addr_t *. This errors did not cause any issues because it just so happens the sizes are the same. Addresses-Coverity: ("Sizeof not portable (SIZEOF_MISMATCH)") Fixes: 16427faf2867 ("[media] tm6000: Add parameter to keep urb bufs allocated") Signed-off-by: Colin Ian King Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/media/usb/tm6000/tm6000-video.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/media/usb/tm6000/tm6000-video.c b/drivers/media/usb/tm6000/tm6000-video.c index bfba06ea60e9d..2df736c029d6e 100644 --- a/drivers/media/usb/tm6000/tm6000-video.c +++ b/drivers/media/usb/tm6000/tm6000-video.c @@ -461,11 +461,12 @@ static int tm6000_alloc_urb_buffers(struct tm6000_core *dev) if (dev->urb_buffer) return 0; - dev->urb_buffer = kmalloc_array(num_bufs, sizeof(void *), GFP_KERNEL); + dev->urb_buffer = kmalloc_array(num_bufs, sizeof(*dev->urb_buffer), + GFP_KERNEL); if (!dev->urb_buffer) return -ENOMEM; - dev->urb_dma = kmalloc_array(num_bufs, sizeof(dma_addr_t *), + dev->urb_dma = kmalloc_array(num_bufs, sizeof(*dev->urb_dma), GFP_KERNEL); if (!dev->urb_dma) return -ENOMEM; -- 2.27.0