lib/driver/mmc.c: remove bug in dereferencing NULL pointer. (Found in testing ;-)

test/driver/mmc.c: MMC command testing code from Thomas Schmitt.
This commit is contained in:
R. Bernstein
2009-12-31 13:28:11 -05:00
parent 6eabc5240a
commit 7e14578ffe
3 changed files with 740 additions and 2 deletions

View File

@@ -967,9 +967,10 @@ mmc_run_cmd_len( const CdIo_t *p_cdio, unsigned int i_timeout_ms,
int
mmc_last_cmd_sense( const CdIo_t *p_cdio, unsigned char **sense)
{
generic_img_private_t *gen = p_cdio->env;
generic_img_private_t *gen;
if (!p_cdio) return DRIVER_OP_UNINIT;
gen = p_cdio->env;
*sense = NULL;
if (gen->scsi_mmc_sense_valid <= 0)
return 0;