Remove a useless test
If card is NULL we can't dereference card->ctx to log an error We must assume card i snever NULL card-oberthur.c:1537:3: warning: Field access results in a dereference of a null pointer (loaded from variable 'card') ...SC_FUNC_RETURN(card->ctx, SC_LOG_DEBUG_NORMAL, SC_ERROR_INVALID_ARGUMENTS)... ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ card-oberthur.c:1537:24: note: instantiated from: SC_FUNC_RETURN(card->ctx, SC_LOG_DEBUG_NORMAL, ... ~~~~ ^ card-oberthur.c:2258:3: warning: Field access results in a dereference of a null pointer (loaded from variable 'card') ...SC_FUNC_RETURN(card->ctx, SC_LOG_DEBUG_NORMAL, SC_ERROR_INVALID_ARGUMENTS)... ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ card-oberthur.c:2258:24: note: instantiated from: SC_FUNC_RETURN(card->ctx, SC_LOG_DEBUG_NORMAL, ... ~~~~ ^ git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5168 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
parent
dd55567cf9
commit
870a00cc8a
|
@ -1531,7 +1531,7 @@ auth_read_component(struct sc_card *card, enum SC_CARDCTL_OBERTHUR_KEY_TYPE type
|
|||
static int
|
||||
auth_get_pin_reference (struct sc_card *card, int type, int reference, int cmd, int *out_ref)
|
||||
{
|
||||
if (!card || !out_ref)
|
||||
if (!out_ref)
|
||||
SC_FUNC_RETURN(card->ctx, SC_LOG_DEBUG_NORMAL, SC_ERROR_INVALID_ARGUMENTS);
|
||||
|
||||
switch (type) {
|
||||
|
@ -2250,7 +2250,7 @@ auth_delete_record(struct sc_card *card, unsigned int nr_rec)
|
|||
static int
|
||||
auth_get_serialnr(struct sc_card *card, struct sc_serial_number *serial)
|
||||
{
|
||||
if (!card || !serial)
|
||||
if (!serial)
|
||||
SC_FUNC_RETURN(card->ctx, SC_LOG_DEBUG_NORMAL, SC_ERROR_INVALID_ARGUMENTS);
|
||||
|
||||
if (card->serialnr.len==0)
|
||||
|
|
Loading…
Reference in New Issue