From nobody Thu Nov 28 08:32:31 2024 Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DD41C145FE4 for ; Thu, 3 Oct 2024 09:29:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.118.77.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727947752; cv=none; b=gGOFYzx5ipnOzr2NV8dRiH3Y85J5XBbCHsQcTtLotlCsqQQ50qGkgUGHNCKmkTbhxCGJ0anQX1nonpwmBEbbiEHLz+M2m3oJ86ojPRiAS2wVJ0SlZrIfHLIh7rNLOftOEpT5L2di/M7jCYykYkjPEOA8XRy5ubp+BBemQtMEfAM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727947752; c=relaxed/simple; bh=JSB9WIw9JxnQOoNePitqlR/5Ex/fNjhToVd6R1YBh4s=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:MIME-Version: Content-Type:References; b=QTXdF5rFLN2dywlG6lzR8migYYJ+qSSvSq1JglSTKBk4Dlxane0ryfuBaHXSzESt9XNngT/2ILG71++yiwyWTZYweqNOVABjiZFdLDeaErYhP2Phtisg7YdtXkLbnQ3r8t/V88pakh77Zcn0cIiLV9IQvBbBW7ZRdkeCUtbMg7k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b=fS39ckIQ; arc=none smtp.client-ip=210.118.77.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="fS39ckIQ" Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20241003092900euoutp017850b30028169b9601755ddad3473520~651CzTqSP2101021010euoutp01O for ; Thu, 3 Oct 2024 09:29:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20241003092900euoutp017850b30028169b9601755ddad3473520~651CzTqSP2101021010euoutp01O DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1727947740; bh=b+sY4M2Lm+Vxr30NniNpscgNlYElLQh2+ZLf9+Vmr/A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fS39ckIQDNqqpyDZkOZMlH0DsYQ8a+Fksl+pv4YGgNjyxUdulGgAr2/P1Bp/UCLkR GgXPgPbOHsiGpTiQhwXUSWU7kPbGPZoTliOhAhtJAeQs7sbPbo1sEXSzxvoD/q5e3l dNZUFPguqjVxiJZz5/pENDQZgD8F0x9rfmsUbv7I= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20241003092900eucas1p10bb65e87ef86d0a3fb0afd81e971eb40~651CWqeEG2406024060eucas1p1i; Thu, 3 Oct 2024 09:29:00 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 6D.D2.09875.CD36EF66; Thu, 3 Oct 2024 10:29:00 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20241003092859eucas1p242fdefaa83bae892cf523019cb7c7003~651B3UUA21289512895eucas1p2P; Thu, 3 Oct 2024 09:28:59 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20241003092859eusmtrp1676d6803c9dc1328e99669aec0d0040f~651B2tlbG1370213702eusmtrp1d; Thu, 3 Oct 2024 09:28:59 +0000 (GMT) X-AuditID: cbfec7f4-11bff70000002693-9c-66fe63dc1014 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 68.57.19096.BD36EF66; Thu, 3 Oct 2024 10:28:59 +0100 (BST) Received: from AMDC4653.digital.local (unknown [106.120.51.32]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20241003092859eusmtip24df80fe60325fbb20c24239c3695535f~651BMgdIu1782517825eusmtip2J; Thu, 3 Oct 2024 09:28:59 +0000 (GMT) From: Marek Szyprowski To: Raspberry Pi Kernel Maintenance , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Marek Szyprowski , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Dave Stevenson , Javier Martinez Canillas Subject: [PATCH 1/2] drm/fbdev-helper: fail if driver provides no fbdev/fb probe functions Date: Thu, 3 Oct 2024 11:28:25 +0200 Message-Id: <20241003092826.1942901-2-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241003092826.1942901-1-m.szyprowski@samsung.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrPKsWRmVeSWpSXmKPExsWy7djPc7p3kv+lGdydIGhx4voiJou3cxez WFz5+p7NYuG05YwW72dOYLa4vGsOm8XaI3fZLRZ+3Mpi0da5jNVi9rv97BZb3kxkdeD22Ptt AYvHzll32T02repk85h3MtDjfvdxJo/Wo79YPN7vu8rm0bdlFaPH5tPVHp83yQVwRXHZpKTm ZJalFunbJXBlLH53jL1gEXtF86Q1TA2MU9m6GDk5JARMJE4+n8fexcjFISSwglFixfzdLBDO F0aJh1susEI4n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rm0bdlFaPH5tPVHp83yQVwRenZFOWX lqQqZOQXl9gqRRtaGOkZWlroGZlY6hkam8daGZkq6dvZpKTmZJalFunbJehlLH53jL1gEXtF 86Q1TA2MU9m6GDk5JARMJH697wOyuTiEBJYySjw+uI4ZIiEjcXJaAyuELSzx51oXVNEnRolX /56BdbMJGEp0vYVIiAi0MEoc3fibEcRhFnjCJLH021ZGkCphgSiJG78Wgo1lEVCVmHj/Llg3 r4C9xPJHv6DukJfYf/AsWA2ngIPE5huvwFYLAdUc3vSXEaJeUOLkzCcsIDYzUH3z1tnMExgF ZiFJzUKSWsDItIpRJLW0ODc9t9hIrzgxt7g0L10vOT93EyMw3rYd+7llB+PKVx/1DjEycTAe YpTgYFYS4Z23/W+aEG9KYmVValF+fFFpTmrxIUZToLsnMkuJJucDIz6vJN7QzMDU0MTM0sDU 0sxYSZyX7cr5NCGB9MSS1OzU1ILUIpg+Jg5OqQYmax+5l/svLuo6xTDpRitDoerptiXNT++L SEZvVTrExf4lwMzQSt+aSzPH2yTpv+RVs/XmIkfq2Of0pOearugqnP35198a+WfrL+lPOzPr pI9X5IXNOgUzj2bvT+XcpByaZjBb7XGMMveRqL11Lb/NXt9WLAnZv+tCtf5neyHRk/sPsCqV /bz0d/v6aavvRej2n0/Ud2IRl7my7oWpgoBm7Pa/b3asWR5y7ojs4YqTV9/9OikeXp+Yf63j zYX0fUu/NU6KXnkrSO/xe8dtimoXtb6FfPt1u2WSINslnqKJJns759n9swueHdVsq+S0z7F2 Q3581rVvsUsqNr/efSepcmqpi/i+SfdXhjSzby27psRSnJFoqMVcVJwIADPOiBlAAwAA X-CMS-MailID: 20241003092859eucas1p242fdefaa83bae892cf523019cb7c7003 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20241003092859eucas1p242fdefaa83bae892cf523019cb7c7003 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20241003092859eucas1p242fdefaa83bae892cf523019cb7c7003 References: <20241003092826.1942901-1-m.szyprowski@samsung.com> If caller doesn't provide driver->fbdev_probe nor funcs->fb_probe, then fail early instead of causing potential NULL pointer dereference, because fb_helper->fb won't be initialized in such case. Fixes: 5d08c44e47b9 ("drm/fbdev: Add memory-agnostic fbdev client") Signed-off-by: Marek Szyprowski --- drivers/gpu/drm/drm_fb_helper.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helpe= r.c index d5e8994345bb..fc260832326c 100644 --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c @@ -1635,6 +1635,9 @@ static int drm_fb_helper_single_fb_probe(struct drm_f= b_helper *fb_helper) ret =3D dev->driver->fbdev_probe(fb_helper, &sizes); else if (fb_helper->funcs) ret =3D fb_helper->funcs->fb_probe(fb_helper, &sizes); + else + ret =3D -ENODEV; + if (ret < 0) return ret; =20 --=20 2.34.1