summaryrefslogtreecommitdiff
path: root/type_decoder.c
diff options
context:
space:
mode:
authorUwe Hermann <uwe@hermann-uwe.de>2018-05-15 22:29:49 +0200
committerUwe Hermann <uwe@hermann-uwe.de>2018-05-15 22:30:35 +0200
commit73578d2ececd3a285ee3bb231de5d074195b6514 (patch)
tree7967d5f805fbfbdebf23bc0036408e9b861de3ec /type_decoder.c
parent5d1d5597d953b5a4a44938ee295aa3386d84e799 (diff)
downloadlibsigrokdecode-73578d2ececd3a285ee3bb231de5d074195b6514.tar.gz
libsigrokdecode-73578d2ececd3a285ee3bb231de5d074195b6514.zip
get_current_pinvalues(): Slightly simplify a code chunk.
Diffstat (limited to 'type_decoder.c')
-rw-r--r--type_decoder.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/type_decoder.c b/type_decoder.c
index 16e25a7..a01d785 100644
--- a/type_decoder.c
+++ b/type_decoder.c
@@ -518,14 +518,13 @@ static PyObject *get_current_pinvalues(const struct srd_decoder_inst *di)
PyObject *py_pinvalues;
PyGILState_STATE gstate;
- gstate = PyGILState_Ensure();
-
if (!di) {
srd_err("Invalid decoder instance.");
- PyGILState_Release(gstate);
return NULL;
}
+ gstate = PyGILState_Ensure();
+
py_pinvalues = PyTuple_New(di->dec_num_channels);
for (i = 0; i < di->dec_num_channels; i++) {