Re: [PATCH libgpiod] bindings: python: fix incorrect object size

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

 



On Tue, Oct 6, 2020 at 7:21 PM Jiri Benc <jbenc@xxxxxxx> wrote:
>
> tp_basicsize is the size of the allocated object, not of the class.
>
> Fixes: 96c524c4951c ("bindings: implement python bindings")
> Signed-off-by: Jiri Benc <jbenc@xxxxxxx>
> ---
>  bindings/python/gpiodmodule.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/bindings/python/gpiodmodule.c b/bindings/python/gpiodmodule.c
> index e5db26b88954..b3ae2bfebb8a 100644
> --- a/bindings/python/gpiodmodule.c
> +++ b/bindings/python/gpiodmodule.c
> @@ -1874,7 +1874,7 @@ PyDoc_STRVAR(gpiod_LineBulkType_doc,
>  static PyTypeObject gpiod_LineBulkType = {
>         PyVarObject_HEAD_INIT(NULL, 0)
>         .tp_name = "gpiod.LineBulk",
> -       .tp_basicsize = sizeof(gpiod_LineBulkType),
> +       .tp_basicsize = sizeof(gpiod_LineBulkObject),
>         .tp_flags = Py_TPFLAGS_DEFAULT,
>         .tp_doc = gpiod_LineBulkType_doc,
>         .tp_new = PyType_GenericNew,
> --
> 2.18.1
>

Applied to master and backported to v1.6.x and v1.4.x, thanks!

Bartosz



[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