Skip to contentSkip to conversation

ASoC: Check return value of strict_strtoul() in WM8962

PATCH New Mark Brown 1 participant 1 message Nov 3, 2010

Subsystems (3)
lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/1 ASoC: Check return value of strict_strtoul() in WM8962

strict_strtoul() has been made __must_check so do so.

---
 sound/soc/codecs/wm8962.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
sound/soc/codecs/wm8962.c +4 -1
index 894d0cd..e809274 100644
@@ -3500,8 +3500,11 @@ static ssize_t wm8962_beep_set(struct device *dev,
 {
 	struct wm8962_priv *wm8962 = dev_get_drvdata(dev);
 	long int time;
+	int ret;
 
-	strict_strtol(buf, 10, &time);
+	ret = strict_strtol(buf, 10, &time);
+	if (ret != 0)
+		return ret;
 
 	input_event(wm8962->beep, EV_SND, SND_TONE, time);
 
Signature · 1 line
1.7.1