diff options
| author | Tatenda Chipeperekwa <tatendac@codeaurora.org> | 2017-01-30 17:22:48 -0800 |
|---|---|---|
| committer | Tatenda Chipeperekwa <tatendac@codeaurora.org> | 2017-02-06 09:03:51 -0800 |
| commit | 0a3e9cc834f77c509df4ae0798b3df2164219782 (patch) | |
| tree | a32b409be1ed8a9a68b401826fb42f1074d4d30c | |
| parent | 864ea9fc787fbf2b830eaf12fe885975e9e85946 (diff) | |
msm: mdss: dp: add null check for token value
Add a null check for a token value that is returned
from a string splitting function. This will prevent
null pointer dereferencing when attempting to use the
token.
CRs-Fixed: 2002785
Change-Id: I6d3c1dafc2c7d0914c116c73a8ed115c2c8f9e86
Signed-off-by: Tatenda Chipeperekwa <tatendac@codeaurora.org>
| -rw-r--r-- | drivers/video/fbdev/msm/mdss_dp.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/video/fbdev/msm/mdss_dp.c b/drivers/video/fbdev/msm/mdss_dp.c index f3c36c5c6b5a..c357e4f8807f 100644 --- a/drivers/video/fbdev/msm/mdss_dp.c +++ b/drivers/video/fbdev/msm/mdss_dp.c @@ -2270,6 +2270,11 @@ static int mdss_dp_parse_config_value(char const *buf, char const *name, if (buf1) { buf1 = buf1 + strlen(name); token = strsep(&buf1, " "); + if (!token) { + pr_err("strsep failed\n"); + ret = -EINVAL; + goto end; + } ret = kstrtou32(token, 10, val); if (ret) { pr_err("kstrtoint failed. ret=%d\n", (int)ret); |
