> +                       if (pin->request_count <= 1) {
> +                               pin->request_count = 0;
> +                               gpio_free(pin->gpio);
> +                               list_del(&pin->list);
> +                               kfree(pin);
> +                       } else {
> +                               pin->request_count--;
> +                       }

How about change above lines to this:

if (--pin->request_count == 0) {
        gpio_free(pin->gpio);
        list_del(&pin->list);
        kfree(pin);
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to