Message ID | bfe529765a0f1d428c7ce2c222dd3a17aba2e058.1602004154.git.jbenc@upir.cz |
---|---|
State | New |
Headers | show |
Series | [libgpiod] bindings: python: fix incorrect object size | expand |
On Tue, Oct 6, 2020 at 7:21 PM Jiri Benc <jbenc@upir.cz> 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@upir.cz> > --- > 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
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,
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@upir.cz> --- bindings/python/gpiodmodule.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)