Re: [PATCH V3 4/4] mmc: pwrseq_simple: Add support for a reset GPIO pin

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 16 January 2015 at 13:45, Sascha Hauer <s.hauer@xxxxxxxxxxxxxx> wrote:
> On Fri, Jan 16, 2015 at 01:37:41PM +0100, Ulf Hansson wrote:
>> On 16 January 2015 at 12:34, Tomeu Vizoso <tomeu.vizoso@xxxxxxxxxxxxx> wrote:
>> > On 16 January 2015 at 11:47, Ulf Hansson <ulf.hansson@xxxxxxxxxx> wrote:
>> >>
>> >>  int mmc_pwrseq_simple_alloc(struct mmc_host *host, struct device *dev)
>> >>  {
>> >>         struct mmc_pwrseq_simple *pwrseq;
>> >> +       int ret = 0;
>> >>
>> >>         pwrseq = kzalloc(sizeof(struct mmc_pwrseq_simple), GFP_KERNEL);
>> >>         if (!pwrseq)
>> >>                 return -ENOMEM;
>> >>
>> >> +       pwrseq->reset_gpio = gpiod_get_index(dev, "reset", 0, GPIOD_OUT_HIGH);
>> >> +       if (IS_ERR(pwrseq->reset_gpio) &&
>> >> +               PTR_ERR(pwrseq->reset_gpio) != -ENOENT &&
>> >> +               PTR_ERR(pwrseq->reset_gpio) != -ENOSYS) {
>> >> +               ret = PTR_ERR(pwrseq->reset_gpio);
>> >> +               goto free;
>> >> +       }
>> >> +
>> >>         pwrseq->pwrseq.ops = &mmc_pwrseq_simple_ops;
>> >>         host->pwrseq = &pwrseq->pwrseq;
>> >>
>> >>         return 0;
>> >> +free:
>> >> +       kfree(&pwrseq);
>> >
>> > Hi Ulf,
>> >
>> > this kfree looks a bit fishy (there's one more instance of it in
>> > mmc_pwrseq_simple_free).
>>
>> This is the error path, which means I need to clean up data that I
>> have allocated.
>
> I think Tomeu meant that the '&' must be removed.
>

Of course, thanks!

Unless I get some more comments I will fix it when I queue the patch.

Kind regards
Uffe
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]
  Powered by Linux