pickit2: avoid NULL dereference in close code path

This commit is contained in:
Gerhard Sittig 2018-12-19 12:41:29 +01:00 committed by Uwe Hermann
parent f3549a1ccf
commit fbbf21dcf5
1 changed files with 2 additions and 0 deletions

View File

@ -232,6 +232,8 @@ static int dev_close(struct sr_dev_inst *sdi)
usb = sdi->conn;
devc = sdi->priv;
if (!usb)
return SR_OK;
if (!usb->devhdl)
return SR_OK;