Эх сурвалжийг харах

disp: msm: dsi: Fix compilation error with -fno-builtin removed

Fix compilation error observed with -fno-builtin compilation
flag removed.

Change-Id: I07ac73db206fab3a1b648d7b656e002c6d347b3b
Signed-off-by: Neeraj Upadhyay <[email protected]>
Signed-off-by: Satya Rama Aditya Pinapala <[email protected]>
Neeraj Upadhyay 5 жил өмнө
parent
commit
7d33aeb87e

+ 6 - 3
msm/dsi/dsi_parser.c

@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 // SPDX-License-Identifier: GPL-2.0-only
 /*
 /*
- * Copyright (c) 2018-2019, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
  */
  */
 
 
 #include <linux/delay.h>
 #include <linux/delay.h>
@@ -239,15 +239,18 @@ static bool dsi_parser_parse_prop(struct device *dev,
 {
 {
 	bool found = false;
 	bool found = false;
 	char *out = strsep(&buf, "=");
 	char *out = strsep(&buf, "=");
+	size_t buf_len;
 
 
 	if (!out || !buf)
 	if (!out || !buf)
 		goto end;
 		goto end;
 
 
-	prop->raw = devm_kzalloc(dev, strlen(buf) + 1, GFP_KERNEL);
+	buf_len = strlen(buf);
+
+	prop->raw = devm_kzalloc(dev, buf_len + 1, GFP_KERNEL);
 	if (!prop->raw)
 	if (!prop->raw)
 		goto end;
 		goto end;
 
 
-	strlcpy(prop->raw, buf, strlen(buf) + 1);
+	strlcpy(prop->raw, buf, buf_len + 1);
 
 
 	found = true;
 	found = true;