Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

pinctrl: single: Fix incorrect type for error return variable

pcs_pinconf_get() and pcs_pinconf_set() declare ret as unsigned int,
but assign it the return values of pcs_get_function() that may return
negative error codes. This causes negative error codes to be
converted to large positive values.

Change ret from unsigned int to int in both functions.

Fixes: 9dddb4df90d1 ("pinctrl: single: support generic pinconf")
Signed-off-by: Haotian Zhang <vulab@iscas.ac.cn>
Signed-off-by: Linus Walleij <linusw@kernel.org>

authored by

Haotian Zhang and committed by
Linus Walleij
61d1bb53 ac52b4a9

+4 -3
+4 -3
drivers/pinctrl/pinctrl-single.c
··· 485 485 struct pcs_device *pcs = pinctrl_dev_get_drvdata(pctldev); 486 486 struct pcs_function *func; 487 487 enum pin_config_param param; 488 - unsigned offset = 0, data = 0, i, j, ret; 488 + unsigned offset = 0, data = 0, i, j; 489 + int ret; 489 490 490 491 ret = pcs_get_function(pctldev, pin, &func); 491 492 if (ret) ··· 550 549 { 551 550 struct pcs_device *pcs = pinctrl_dev_get_drvdata(pctldev); 552 551 struct pcs_function *func; 553 - unsigned offset = 0, shift = 0, i, data, ret; 552 + unsigned offset = 0, shift = 0, i, data; 554 553 u32 arg; 555 - int j; 554 + int j, ret; 556 555 enum pin_config_param param; 557 556 558 557 ret = pcs_get_function(pctldev, pin, &func);