clk: requests: Dereference the request pointer after the check
authorMaxime Ripard <maxime@cerno.tech>
Thu, 22 Apr 2021 08:45:37 +0000 (10:45 +0200)
committerDom Cobley <popcornmix@gmail.com>
Mon, 21 Mar 2022 16:04:14 +0000 (16:04 +0000)
commitc9863783224eb92f96c74a9fe49ad34146fb95be
tree9380ea70fe4360c446a25488b6d88b6e23483279
parentde20632f368954fc4d485bae8030d21b74ad4f36
clk: requests: Dereference the request pointer after the check

The current code will first dereference the req pointer and then test if
it's NULL, resulting in a NULL pointer dereference if req is indeed
NULL. Reorder the test and derefence to avoid the issue

Signed-off-by: Maxime Ripard <maxime@cerno.tech>
drivers/clk/clk.c