On Fri, Jan 9, 2015 at 2:08 PM, Varka Bhadram <[email protected]> wrote:
> From: Varka Bhadram <[email protected]>
>
> ioport_map() may fail. Its safe to check the return value.
>
> Signed-off-by: Varka Bhadram <[email protected]>
> ---
>  drivers/gpio/gpio-amd8111.c |    5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/drivers/gpio/gpio-amd8111.c b/drivers/gpio/gpio-amd8111.c
> index d3d2d10..2c4d9ab 100644
> --- a/drivers/gpio/gpio-amd8111.c
> +++ b/drivers/gpio/gpio-amd8111.c
> @@ -213,6 +213,11 @@ found:
>                 goto out;
>         }
>         gp.pm = ioport_map(gp.pmbase + PMBASE_OFFSET, PMBASE_SIZE);
> +       if (!gp.pm) {
> +               dev_err(&pdev->dev, "Couldn't map io port into io memory\n");
> +               err = -ENOMEM;
> +               goto out;

You are not calling release_region() to free the region requested right above.
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to