diff options
author | Aniruddha TVS Rao <anrao@nvidia.com> | 2017-03-21 01:25:39 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-03-22 05:46:00 -0400 |
commit | a021b3516c6d979b757cca37afdad910e6361ed6 (patch) | |
tree | 048a1763cfb2448d130f1f7fd23d02213d6ffbca /drivers/pinctrl/pinctrl-tegra186-padctl.c | |
parent | 4200eef4d920ab9f79dd3c70fa3806b5c167b2ae (diff) |
drivers: pinctrl: Avoid unchecked return value
pinctrl_select_state is called without checking the return value.
return value indicates either success or error.
Fixed by capturing the return value and using it in the error message.
Coverity ID 2032678
Coverity ID 2032679
Change-Id: I93f67176026814c35c8dbc34c2ec81f8e8bce288
Signed-off-by: Aniruddha TVS Rao <anrao@nvidia.com>
Reviewed-on: http://git-master/r/1314504
Reviewed-by: Petlozu Pravareshwar <petlozup@nvidia.com>
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Diffstat (limited to 'drivers/pinctrl/pinctrl-tegra186-padctl.c')
-rw-r--r-- | drivers/pinctrl/pinctrl-tegra186-padctl.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/drivers/pinctrl/pinctrl-tegra186-padctl.c b/drivers/pinctrl/pinctrl-tegra186-padctl.c index eb5844b06..a15c5ee57 100644 --- a/drivers/pinctrl/pinctrl-tegra186-padctl.c +++ b/drivers/pinctrl/pinctrl-tegra186-padctl.c | |||
@@ -3119,9 +3119,15 @@ static int tegra186_padctl_probe(struct platform_device *pdev) | |||
3119 | 3119 | ||
3120 | restore_oc_pin: | 3120 | restore_oc_pin: |
3121 | if (padctl->oc_pinctrl) | 3121 | if (padctl->oc_pinctrl) |
3122 | for (i--; i >= 0; i--) | 3122 | for (i--; i >= 0; i--) { |
3123 | pinctrl_select_state(padctl->oc_pinctrl, | 3123 | err = pinctrl_select_state(padctl->oc_pinctrl, |
3124 | padctl->oc_disable[i]); | 3124 | padctl->oc_disable[i]); |
3125 | if (err < 0) | ||
3126 | dev_err(dev, | ||
3127 | "set pin %d OC disable failed: %d\n", | ||
3128 | i, err); | ||
3129 | } | ||
3130 | |||
3125 | 3131 | ||
3126 | free_mailbox: | 3132 | free_mailbox: |
3127 | if (!IS_ERR(padctl->mbox_chan)) { | 3133 | if (!IS_ERR(padctl->mbox_chan)) { |
@@ -3148,12 +3154,18 @@ static int tegra186_padctl_remove(struct platform_device *pdev) | |||
3148 | { | 3154 | { |
3149 | struct tegra_padctl *padctl = platform_get_drvdata(pdev); | 3155 | struct tegra_padctl *padctl = platform_get_drvdata(pdev); |
3150 | int i; | 3156 | int i; |
3157 | int err; | ||
3151 | 3158 | ||
3152 | /* switch all VBUS_ENx pins back to default state */ | 3159 | /* switch all VBUS_ENx pins back to default state */ |
3153 | if (padctl->oc_pinctrl) | 3160 | if (padctl->oc_pinctrl) |
3154 | for (i = 0; i < padctl->soc->num_oc_pins; i++) | 3161 | for (i = 0; i < padctl->soc->num_oc_pins; i++) { |
3155 | pinctrl_select_state(padctl->oc_pinctrl, | 3162 | err = pinctrl_select_state(padctl->oc_pinctrl, |
3156 | padctl->oc_disable[i]); | 3163 | padctl->oc_disable[i]); |
3164 | if (err < 0) | ||
3165 | dev_err(&pdev->dev, | ||
3166 | "set pin %d OC disable failed: %d\n", | ||
3167 | i, err); | ||
3168 | } | ||
3157 | 3169 | ||
3158 | sysfs_remove_group(&pdev->dev.kobj, &padctl_attr_group); | 3170 | sysfs_remove_group(&pdev->dev.kobj, &padctl_attr_group); |
3159 | 3171 | ||