initialize sm_ctx with 0s for iso7816 driver

This commit is contained in:
Frank Morgner 2013-06-06 20:46:48 +02:00 committed by Viktor Tarasov
parent 6707f92b38
commit ff637bd02a
1 changed files with 11 additions and 1 deletions

View File

@ -1066,6 +1066,16 @@ iso7816_pin_cmd(struct sc_card *card, struct sc_pin_cmd_data *data, int *tries_l
}
static int
iso7816_init(struct sc_card *card)
{
#if ENABLE_SM
memset(&card->sm_ctx, 0, sizeof card->sm_ctx);
#endif
return SC_SUCCESS;
}
static int
no_match(struct sc_card *card)
{
@ -1074,7 +1084,7 @@ no_match(struct sc_card *card)
static struct sc_card_operations iso_ops = {
no_match,
NULL, /* init */
iso7816_init, /* init */
NULL, /* finish */
iso7816_read_binary,
iso7816_write_binary,