linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] watchdog: stm32: replace "%p" with "%pK"
@ 2018-07-06 13:08 Benjamin Gaignard
  2018-07-07 21:26 ` Guenter Roeck
  0 siblings, 1 reply; 2+ messages in thread
From: Benjamin Gaignard @ 2018-07-06 13:08 UTC (permalink / raw)
  To: wim, linux, mcoquelin.stm32, alexandre.torgue
  Cc: linux-watchdog, linux-arm-kernel, linux-kernel, Benjamin Gaignard

The format specifier "%p" can leak kernel addresses.
Use "%pK" instead.

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@st.com>
---
 drivers/watchdog/stm32_iwdg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/watchdog/stm32_iwdg.c b/drivers/watchdog/stm32_iwdg.c
index c97ad5619cb0..740f74a98644 100644
--- a/drivers/watchdog/stm32_iwdg.c
+++ b/drivers/watchdog/stm32_iwdg.c
@@ -172,7 +172,7 @@ static int stm32_iwdg_probe(struct platform_device *pdev)
 
 	ret = clk_prepare_enable(clk);
 	if (ret) {
-		dev_err(&pdev->dev, "Unable to prepare clock %p\n", clk);
+		dev_err(&pdev->dev, "Unable to prepare clock %pK\n", clk);
 		return ret;
 	}
 
-- 
2.15.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] watchdog: stm32: replace "%p" with "%pK"
  2018-07-06 13:08 [PATCH] watchdog: stm32: replace "%p" with "%pK" Benjamin Gaignard
@ 2018-07-07 21:26 ` Guenter Roeck
  0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2018-07-07 21:26 UTC (permalink / raw)
  To: Benjamin Gaignard
  Cc: wim, mcoquelin.stm32, alexandre.torgue, linux-watchdog,
	linux-arm-kernel, linux-kernel, Benjamin Gaignard

On Fri, Jul 06, 2018 at 03:08:08PM +0200, Benjamin Gaignard wrote:
> The format specifier "%p" can leak kernel addresses.
> Use "%pK" instead.
> 
The pointer has zero value either way. If the clock has a name,
it might make sense to display it. Otherwise just drop the pointer.

Guenter

> Signed-off-by: Benjamin Gaignard <benjamin.gaignard@st.com>
> ---
>  drivers/watchdog/stm32_iwdg.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/watchdog/stm32_iwdg.c b/drivers/watchdog/stm32_iwdg.c
> index c97ad5619cb0..740f74a98644 100644
> --- a/drivers/watchdog/stm32_iwdg.c
> +++ b/drivers/watchdog/stm32_iwdg.c
> @@ -172,7 +172,7 @@ static int stm32_iwdg_probe(struct platform_device *pdev)
>  
>  	ret = clk_prepare_enable(clk);
>  	if (ret) {
> -		dev_err(&pdev->dev, "Unable to prepare clock %p\n", clk);
> +		dev_err(&pdev->dev, "Unable to prepare clock %pK\n", clk);
>  		return ret;
>  	}
>  
> -- 
> 2.15.0
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-07-07 21:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-06 13:08 [PATCH] watchdog: stm32: replace "%p" with "%pK" Benjamin Gaignard
2018-07-07 21:26 ` Guenter Roeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).