diff options
author | Christophe Ricard <christophe.ricard@gmail.com> | 2015-02-01 22:54:24 +0100 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2015-03-26 12:36:18 +0100 |
commit | f1afb65d8163aee64271f03eabd553b989d57cef (patch) | |
tree | b304ceb75ebefec2a4c8eff1464fd41d47161b8b | |
parent | ab08d9fe3e655b2b582b8618b64b36100a818867 (diff) | |
download | neard-f1afb65d8163aee64271f03eabd553b989d57cef.tar.gz |
se: Check for se's io_driver and transceive function pointers
A secure element may exist without any io_driver or without any
transceive function.
-rw-r--r-- | se/se.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -142,7 +142,6 @@ static int send_io(struct seel_se *se) { GList *first; struct seel_se_ioreq *req; - int err; DBG(""); @@ -162,12 +161,13 @@ static int send_io(struct seel_se *se) __seel_apdu_dump(__seel_apdu_data(req->apdu), __seel_apdu_length(req->apdu)); - err = se->io_driver->transceive(se->ctrl_idx, se->se_idx, + if (se->io_driver && se->io_driver->transceive) + return se->io_driver->transceive(se->ctrl_idx, se->se_idx, __seel_apdu_data(req->apdu), __seel_apdu_length(req->apdu), io_cb, req); - return err; + return -EIO; } int __seel_se_queue_io(struct seel_se *se, struct seel_apdu *apdu, |