clk: ti: check for null return in strrchr to avoid null dereferencing
authorColin Ian King <colin.king@canonical.com>
Wed, 26 Jul 2017 23:56:27 +0000 (00:56 +0100)
committerStephen Boyd <sboyd@codeaurora.org>
Fri, 1 Sep 2017 01:44:13 +0000 (18:44 -0700)
commitdf2f84516758788889281e97d736c7863ff200ea
tree36758c824f6a6720282a6c2717c5495c612f6313
parent2316a7a33408b6e7b24e9d2a9a7c24af9a012289
clk: ti: check for null return in strrchr to avoid null dereferencing

strrchr can potentially return a null so the following strlen on the
null pointer can cause a null dereference. Add a check to see if
the string postfix is not null before calling strlen.

Detected by CoverityScan, CID#1452039 ("Dereference null return")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
drivers/clk/ti/adpll.c