Received: by 2002:a05:7208:20d2:b0:82:bbfa:f723 with SMTP id z18csp35103rbz; Tue, 7 May 2024 09:48:25 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVdu42eKCbK/zF/nX4rKDQst06QDxj7eqGDNpbfWetxVihmsOC62ql5JnWVQinplmAhK3WyJUdbazGmmcmOuvClxad67f087GDj4UQn7Q== X-Google-Smtp-Source: AGHT+IG5SDI4rbZw4A8NXtTw+jOZS4Ktu4Zujtt35+KVFWi66VtehkHGQv/YF+jYv2xMYijZjRZO X-Received: by 2002:a05:6122:16a3:b0:4db:223b:1c0a with SMTP id 71dfb90a1353d-4df6935178dmr78774e0c.11.1715100504597; Tue, 07 May 2024 09:48:24 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715100504; cv=pass; d=google.com; s=arc-20160816; b=pGK6cbMXqzA2sxld8cecoCzkisGZaO/hSzDqWq7VKChA1WofNhuP6efiX/VSMWy/mW coIXM2AmPqkMeNAg2N+U4soFVIXkjfE9YSF8AJle+6dTei8IGnhBYath1pGbcaVTp2R+ bOpW37kjc1up78VrFMMxqPd05uFvJ3kqDlQX/lyEM6kn0gQkLG+6KxKYcKL06BLYy9W2 ztfb0Km2guASLD8OnLxCPZDPV+KYwm44//zjkUBjpfo5GFl9gxVXe4Rut8aCbYhKcC31 EcRr4enQj378ncGVszgvCctGTze9Ctf+f7BlfE4UNQdwcnFGf4CI1a6A5VjZW705S3th pL2w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:content-transfer-encoding:references:in-reply-to:date:cc :to:from:subject:message-id:dkim-signature; bh=eDuw6XMtyXZKzrVG8KLN93/CpRj1Z6EUoNzW3VbxI34=; fh=H3hxvMlLsxS+F9fJ01j5rQ56oeRiZb7gXJen1rKSKEI=; b=ByFHmXdBTyNzrLy5UPtSFtvzUNoueEOwibDpKLIBWF9/ACQg8sB9bm6OcGQMqjc0U1 jIXKrn+WTpcSKUSelz25Jn4SZCoO2CeaV/WLfNsVDzTc2Jnbzs2qFutOeosyXCXiFhp+ GoSMFWl/SSe/rTmmTflVXXrOmtmex9FfM9SEQTroQX9Mt08ySrVxwbDWRWCQWsnnh9zy FvJnAB+8aZU3y6yQtNVthcOsVYxmFybra3R8YsRcmAyUDuonT9oFeDUW3W2UWLdwCD2N +UcGZ5BY7ONWwvlSj3t/EwvYZndnTRgbkxI0ejuRVEcESkcQS24KthsH8CtFOmxH8oNg UyiQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JzHD20mv; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-171863-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-171863-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id g21-20020ac87d15000000b0043ab1f6e591si12603503qtb.45.2024.05.07.09.48.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 09:48:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-171863-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JzHD20mv; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-171863-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-171863-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 586681C23106 for ; Tue, 7 May 2024 16:48:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 00196180A6A; Tue, 7 May 2024 16:42:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="JzHD20mv" Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1F84A1802AD for ; Tue, 7 May 2024 16:42:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715100172; cv=none; b=cQqGPasY+iax226gyho1eII85M7GjsBRcwdLLO7NuvsCrAJONKsg8LB4qXpwJRlvlaZv+UujumiK3+PnqNPAa0INnbzXT+aaOvrgZ3MMv0raMo1g0IIh2ump4wQa3znoiYkTWUZv/LXw0NcX7iBYfvSQZrFyImbHwvuPWpau+58= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715100172; c=relaxed/simple; bh=wcF/docFjr+wD8+ZhWWu9ng6Q2+gklOMYNBpSAuz2g0=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=RlIZLZnVyoLO+9MV+snMarlrd1Ek9M6SIC1VMAwDsLUbqDAFPpnFhg0ri+iJZA9AF7w4RNoN7H4At7lQo0qRLsAssMPfM2UZPTT0w9MIyiTLvHGJxHovsE304csDlylOkCtw2yIJcbBB8+UKB17d2h03MDC0AMm85G5KLUTzUmE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=JzHD20mv; arc=none smtp.client-ip=209.85.128.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-41ebcf01013so15228895e9.0 for ; Tue, 07 May 2024 09:42:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1715100166; x=1715704966; darn=vger.kernel.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=eDuw6XMtyXZKzrVG8KLN93/CpRj1Z6EUoNzW3VbxI34=; b=JzHD20mvT+5jIsQESGbkfGhTezCrBEXu35oxNz6+HE+SMl59j4DdZyjxvl38X0XO3Z YFZeR28U8NhogiIeH753Wcf/+oCd+BVaVgMzZ6fp/j5SJE1QwCs5G7zxWYyfCpAwdHk3 HLuHqEj1Z92YNGjGLRvjoI+8FA9/Zsu2laXjPMBMHfJRK01uECJjVKPd5aX+sV56SQHr MImTq4iACwt8TG7jNhh40KW0ppHwTs45hEUIsxC6U+M3FiaAjQk9ggltvCtBYHcDErgA I9dxuD4XlrukFwVFx0n7ffanyI93fGmNK65W9IBto2OEGjrz/da9b+rApXhN++ew7PU6 YQTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715100166; x=1715704966; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=eDuw6XMtyXZKzrVG8KLN93/CpRj1Z6EUoNzW3VbxI34=; b=R02AtC4EHMuUg3+V01lY5BxNg5fblsz/17/bOCTOUwvPeZz9tzEkfiFcpue5qlf0/5 lRTmAUCrOpWwtKUhSdkID/Ym7IDU2Y2QPm6vUEnkfoKUnk0loRsTsnxmpg6nLhAPxJVz dpXluqJldGqHKxCHRItevCORcf7NIwqTAz+sJvMZUtIRue9sSlz0siuMyOMU5E0yPFUb scPsqYVxINxjLO7xjdt4y+RD99gVkQvcv2pbz1nc9KuXybyDl9hP7zTDm8WGJMTInLIS aqNQ6mJAi0CbPV/2QlY2N/9N3zRTpMLCRYqWeaPIwiNmFMZoHUb76Ypr6WyINUdn07TX lPxQ== X-Forwarded-Encrypted: i=1; AJvYcCX96gnxdQME8V/GTzCdW8Nug7EDgFbAzlJUe93sYAL6vydqCWbL8uyCsrtgOdAylsaoIoX7VUL9TIW5rTxpgK11G7uYXbGbg+1MVFUv X-Gm-Message-State: AOJu0YyTK30DnH6TWPbMn/hroazaZ1R6F72diqOiZwJaCJ9ym1gp46VP 3tDmPninR9wLoLT3mYYk2/7a/9gxieJIc3LBChas0mWpUWFga/1OD/v4uaa3ehG/6uAooXxnfek zUfaJ0Q== X-Received: by 2002:a05:600c:314c:b0:41c:2334:fffd with SMTP id 5b1f17b1804b1-41f71cc19bcmr3656375e9.9.1715100166177; Tue, 07 May 2024 09:42:46 -0700 (PDT) Received: from draszik.lan ([80.111.64.44]) by smtp.gmail.com with ESMTPSA id f20-20020a05600c4e9400b0041b5500e438sm20245506wmq.23.2024.05.07.09.42.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 09:42:45 -0700 (PDT) Message-ID: Subject: Re: [PATCH] clkdev: fix potential NULL pointer dereference From: =?ISO-8859-1?Q?Andr=E9?= Draszik To: Marek Szyprowski , linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Russell King , Michael Turquette , Stephen Boyd Date: Tue, 07 May 2024 17:42:45 +0100 In-Reply-To: <20240507064434.3213933-1-m.szyprowski@samsung.com> References: <20240507064434.3213933-1-m.szyprowski@samsung.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.50.3-1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Hi Marek, On Tue, 2024-05-07 at 08:44 +0200, Marek Szyprowski wrote: > diff --git a/drivers/clk/clkdev.c b/drivers/clk/clkdev.c > index ddacab7863d0..d2801ae70e34 100644 > --- a/drivers/clk/clkdev.c > +++ b/drivers/clk/clkdev.c > @@ -194,10 +194,12 @@ vclkdev_alloc(struct clk_hw *hw, const char *con_id= , const char *dev_fmt, > =C2=A0 return &cla->cl; > =C2=A0 > =C2=A0fail: > - fmt.fmt =3D dev_fmt; > - fmt.va =3D &ap_copy; > - pr_err("%pV:%s: %s ID is greater than %zu\n", > - =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 &fmt, con_id, failure, max_size); > + if (dev_fmt) { > + fmt.fmt =3D dev_fmt; > + fmt.va =3D &ap_copy; > + pr_err("%pV:%s: %s ID is greater than %zu\n", > + =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 &fmt, con_id, failure, max_size); > + } It might be nice to still print the rest of the error, so it's easier to se= e which clock is causing trouble. Cheers, Andre'