Re: [PATCH] tools: Change asprintf return code check

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

 



On Thu, Sep 8, 2022 at 4:03 PM Catalin Petrescu
<catalin.petrescu@xxxxxxxxx> wrote:
>
> Hi there,
>
> I found a small error (IMHO) in libgpiod.
> The issue is that asprintf may return -1 if it fails to allocate
> memory, and if that happens, chip_open_by_number will pass a NULL
> pointer to gpiod_chip_open.
>
> I hope this helps.
>
> Thanks,
>
> Catalin.

Hey Catalin,

Please next time send the patch inline using git's send-email command.

You're right about the error code check but it should actually be ret
< 0 as per asprintf's documentation.

Bart



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux