pn53x_data_new() now returns null ptr upon malloc() error
This commit is contained in:
parent
af57df532b
commit
06d5b54308
8 changed files with 55 additions and 12 deletions
|
|
@ -337,7 +337,10 @@ pn53x_usb_open(const nfc_context *context, const nfc_connstring connstring)
|
|||
*DRIVER_DATA(pnd) = data;
|
||||
|
||||
// Alloc and init chip's data
|
||||
pn53x_data_new(pnd, &pn53x_usb_io);
|
||||
if (pn53x_data_new(pnd, &pn53x_usb_io) == NULL) {
|
||||
perror("malloc");
|
||||
goto error;
|
||||
}
|
||||
|
||||
switch (DRIVER_DATA(pnd)->model) {
|
||||
// empirical tuning
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue