All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] clk: zynqmp: Add a check for NULL pointer
@ 2022-05-18  5:53 Shubhrajyoti Datta
  2022-07-14 12:32 ` Michal Simek
  2022-08-22 23:59 ` Stephen Boyd
  0 siblings, 2 replies; 3+ messages in thread
From: Shubhrajyoti Datta @ 2022-05-18  5:53 UTC (permalink / raw)
  To: linux-clk; +Cc: mturquette, michal.simek, git, Shubhrajyoti Datta

Add a NULL pointer check as clk_hw_get_parent can return NULL.

Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
---
 drivers/clk/zynqmp/divider.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/zynqmp/divider.c b/drivers/clk/zynqmp/divider.c
index 422ea79907dd..8d1a21214084 100644
--- a/drivers/clk/zynqmp/divider.c
+++ b/drivers/clk/zynqmp/divider.c
@@ -120,10 +120,13 @@ static void zynqmp_get_divider2_val(struct clk_hw *hw,
 	long error = LONG_MAX;
 	unsigned long div1_prate;
 	struct clk_hw *div1_parent_hw;
+	struct zynqmp_clk_divider *pdivider;
 	struct clk_hw *div2_parent_hw = clk_hw_get_parent(hw);
-	struct zynqmp_clk_divider *pdivider =
-				to_zynqmp_clk_divider(div2_parent_hw);
 
+	if (!div2_parent_hw)
+		return;
+
+	pdivider = to_zynqmp_clk_divider(div2_parent_hw);
 	if (!pdivider)
 		return;
 
-- 
2.25.1


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

* Re: [PATCH] clk: zynqmp: Add a check for NULL pointer
  2022-05-18  5:53 [PATCH] clk: zynqmp: Add a check for NULL pointer Shubhrajyoti Datta
@ 2022-07-14 12:32 ` Michal Simek
  2022-08-22 23:59 ` Stephen Boyd
  1 sibling, 0 replies; 3+ messages in thread
From: Michal Simek @ 2022-07-14 12:32 UTC (permalink / raw)
  To: Shubhrajyoti Datta, linux-clk; +Cc: mturquette, michal.simek, git



On 5/18/22 07:53, Shubhrajyoti Datta wrote:
> Add a NULL pointer check as clk_hw_get_parent can return NULL.
> 
> Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
> ---
>   drivers/clk/zynqmp/divider.c | 7 +++++--
>   1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/clk/zynqmp/divider.c b/drivers/clk/zynqmp/divider.c
> index 422ea79907dd..8d1a21214084 100644
> --- a/drivers/clk/zynqmp/divider.c
> +++ b/drivers/clk/zynqmp/divider.c
> @@ -120,10 +120,13 @@ static void zynqmp_get_divider2_val(struct clk_hw *hw,
>   	long error = LONG_MAX;
>   	unsigned long div1_prate;
>   	struct clk_hw *div1_parent_hw;
> +	struct zynqmp_clk_divider *pdivider;
>   	struct clk_hw *div2_parent_hw = clk_hw_get_parent(hw);
> -	struct zynqmp_clk_divider *pdivider =
> -				to_zynqmp_clk_divider(div2_parent_hw);
>   
> +	if (!div2_parent_hw)
> +		return;
> +
> +	pdivider = to_zynqmp_clk_divider(div2_parent_hw);
>   	if (!pdivider)
>   		return;
>   
> 

Acked-by: Michal Simek <michal.simek@amd.com>

Thanks,
Michal

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

* Re: [PATCH] clk: zynqmp: Add a check for NULL pointer
  2022-05-18  5:53 [PATCH] clk: zynqmp: Add a check for NULL pointer Shubhrajyoti Datta
  2022-07-14 12:32 ` Michal Simek
@ 2022-08-22 23:59 ` Stephen Boyd
  1 sibling, 0 replies; 3+ messages in thread
From: Stephen Boyd @ 2022-08-22 23:59 UTC (permalink / raw)
  To: Shubhrajyoti Datta, linux-clk
  Cc: mturquette, michal.simek, git, Shubhrajyoti Datta

Quoting Shubhrajyoti Datta (2022-05-17 22:53:14)
> Add a NULL pointer check as clk_hw_get_parent can return NULL.
> 
> Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
> ---

Applied to clk-next

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

end of thread, other threads:[~2022-08-22 23:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-18  5:53 [PATCH] clk: zynqmp: Add a check for NULL pointer Shubhrajyoti Datta
2022-07-14 12:32 ` Michal Simek
2022-08-22 23:59 ` Stephen Boyd

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.