From patchwork Sat Apr 20 09:12:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 13637103 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 26C7EC4345F for ; Sat, 20 Apr 2024 09:14:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=KN81miVItIVFNyGezNMuS2poPZimrXpqaQ17PQEP4TY=; b=FOorY0XBsr3xl8 xK9eo0pSRQUNKZJ3kLuRhhy1ARYLj5RzTzXQbJL4gecLNQTTvQbwwYtPBW1R++dofW1xcNpGCOOwc oQtanGHWPcQ4DWjvBrGxMcXhqZUYbpDEcNHentnGncCVTB4avbnwZgO+ajcN9tYtQvZKdMVRhgN9P vxNih3MoZPRr5SuBcYUreXrpdOgIifYKPlkl5TLNWWmvdp8xLD36rmYkEsdprQky2rX39aqziEBoM 4HkSXlR7+nEZiL9OCgeTHmVGGOEa4XBhxXcE8+okNOzvDXPdoQ1BFMjw9i9mtdB4sEwzaPvzL4N83 jd/VTGebx3Cewui0pfXw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1ry6nE-00000008ArX-2cEV; Sat, 20 Apr 2024 09:13:56 +0000 Received: from mout.gmx.net ([212.227.15.18]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1ry6nC-00000008Api-0AKl for linux-arm-kernel@lists.infradead.org; Sat, 20 Apr 2024 09:13:55 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1713604427; x=1714209227; i=wahrenst@gmx.net; bh=NYfpO0Y8BzAMcuNrjb6008bBmLBEvtULE00mErAUMow=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:Message-Id: MIME-Version:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=aqbJKnQQxM1AAHQ3urb0ivxBvDDZ5Kz5GC2oZHK9ahTSdFlZ7RR0L9l9bS75OZKY zS4TkeHY7P61ygMSVPkJ5iKzmE9yFYGe8JRMLOiSgzBPHCJqZfYHhJw82ek6Mf0xt YCpCjDgzJncA0T3JRvZROommL5YNmxOaBEsFExPpKVnEAvEfe8ZK/gTFGzPDOJzOz ARuSOAd+8xyDblrt0OsRbNVZuKujgOVyqu9KWxp34upY7bxWM3dztB+b09+oqIABd vlPsUguULxbRhgBdAWhcPWxgqjcro7PW6UvbCD4Kzr0gD2a8f2DWyoAPCsr33jrp+ q+l8r/rB5X07TCy1gw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from stefanw-SCHENKER ([37.4.248.43]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1M1Ycr-1rzUMi328h-0032iq; Sat, 20 Apr 2024 11:13:47 +0200 From: Stefan Wahren To: Greg Kroah-Hartman , Florian Fainelli Cc: Umang Jain , Laurent Pinchart , linux-staging@lists.linux.dev, linux-arm-kernel@lists.infradead.org, Stefan Wahren Subject: [PATCH V2] staging: vc04_services: vchiq_arm: Fix NULL ptr dereferences Date: Sat, 20 Apr 2024 11:12:40 +0200 Message-Id: <20240420091240.9552-1-wahrenst@gmx.net> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Provags-ID: V03:K1:6FlioDCPMJdPnkc0CPyKL+KMOAXnHuX3V1DI/vFloDMYd/lQiHe Zyn6xp3O7oSHPZxfl+BfdJVxF3ITLK6lLqOt/pl2R2VXVqhSufrRs/ZybdX2jPpZtPpmqTw jUCOGpNJbmrfxvUn1fPWIFRmsX0v+7qaWlsNkAvEPVVKAKw6V3dSVdPM4Dv35NyA08CJTOH jtQTv3M9YnnAgzLR1rYHg== UI-OutboundReport: notjunk:1;M01:P0:j8mADqAS0KU=;J6a6aPfBej26eQC5F7do7uDeFg/ UpFIYwq/gkrtcQptyNqoAUdQlZdF+CwMGZup+mc8soq1rshmv70TV8C1byX3bk00bUJdkp3xE fXgeWRb6rg9YbCG0XGdcx4B4Cswhpioc8fJf510vrVzJVyCHbb8ONpS+E53ACusW+9UjuoKdK bPO4Q1RrggjGXoPaKJcV00k7RXdFCVlZXusqEOvJbj3wlYfx5vcQFO6SDc8aJqFVTWVKn35mS WBfjTJktI88hk/PhC4cVR0o2/nu1LNxuVU5xrCS6FaXcC/MJWiCBhCBMtckAIe2oHiMeGQRJC pF+ndJfYOt0r1Zn5+A2eGaLIGiahzM8jFVCpEI06tK+J+W6rh0I9EDa/Q0j2ZyW9+Y5aKK2FY 1Umqxk46XUoRIYdbebCA3MxwhH/7VBZttj3jIvFE7W3dpEcEWzYnYYq3ir38gN3ia7i+fUAUS 0LbOixmTLUGtXvvufPXI9fhWoaFzViXrGDhNniHNZiB83fpO7kr8dCva1cjMZLBhmXhkP4EqI /8NfkBanyaDFR+WAP7KRrGwM05N+mFRzDdnBHSKuhwd7hC9TTniWpGffr/WFbVj/SXwyHCUeg 3aI/xaosLTNNFqVO1agXx5qCJhWUFecTmYZmZSR0xxEZYOM5HlhbnoSDz0mZPx+ILCx6BESBQ ssQavw21Wf4BK80lIPfS8l2oFa1ywEUV7VY8MiANKFvtSG6fDgJAmKdxGKwo9BjpG0MwwkjNf 0U7+zhQvNpFsrf5Y9xJriJXNwFKnkCGcBi+x1PRJkHdnSZ7bFSpNRjYs82/13SrQXyzWIM6fN iC3TxyVVRPIrk2S60gzIPahAK64wUMGDZNx+QD8Kdkfr8= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240420_021354_395961_BF69A7E7 X-CRM114-Status: GOOD ( 10.78 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The commit 8c9753f63905 ("staging: vc04_services: vchiq_arm: Drop g_cache_line_size") introduced NULL pointer dereferences by using the wrong device. Fixes: 8c9753f63905 ("staging: vc04_services: vchiq_arm: Drop g_cache_line_size") Signed-off-by: Stefan Wahren Reviewed-by: Laurent Pinchart Reviewed-by: Umang Jain --- Changes in V2: - drop cosmetic changes as noticed by Laurent drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.34.1 diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c index 502ddc0f6e46..c06232fcb0fb 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c @@ -257,7 +257,7 @@ create_pagelist(struct vchiq_instance *instance, char *buf, char __user *ubuf, if (count >= INT_MAX - PAGE_SIZE) return NULL; - drv_mgmt = dev_get_drvdata(instance->state->dev->parent); + drv_mgmt = dev_get_drvdata(instance->state->dev); if (buf) offset = (uintptr_t)buf & (PAGE_SIZE - 1); @@ -436,7 +436,7 @@ free_pagelist(struct vchiq_instance *instance, struct vchiq_pagelist_info *pagel dev_dbg(instance->state->dev, "arm: %pK, %d\n", pagelistinfo->pagelist, actual); - drv_mgmt = dev_get_drvdata(instance->state->dev->parent); + drv_mgmt = dev_get_drvdata(instance->state->dev); /* * NOTE: dma_unmap_sg must be called before the