aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Ricard <christophe.ricard@gmail.com>2015-02-01 22:54:24 +0100
committerSamuel Ortiz <sameo@linux.intel.com>2015-03-26 12:36:18 +0100
commitf1afb65d8163aee64271f03eabd553b989d57cef (patch)
treeb304ceb75ebefec2a4c8eff1464fd41d47161b8b
parentab08d9fe3e655b2b582b8618b64b36100a818867 (diff)
downloadneard-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.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/se/se.c b/se/se.c
index e683db7..1280a3f 100644
--- a/se/se.c
+++ b/se/se.c
@@ -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,