Skip to contentSkip to conversation

ide-cd: fix another NULL ptr in debug statement

PATCH In review Borislav Petkov 2 participants 2 messages Sep 25, 2008 – Sep 27, 2008 libata

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ide-cd: fix another NULL ptr in debug statement

Hi Bart,

here's another null ptr fix in the debugging code. I'll be auditing all the debug fragments in case I've missed some.

---
From: Borislav Petkov <[email protected]>
Date: Thu, 25 Sep 2008 09:36:26 +0200
Subject: [PATCH] ide-cd: fix another NULL ptr in debug statement

There should be no functionality change resulting from this patch.

---
 drivers/ide/ide-cd.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)
drivers/ide/ide-cd.c +7 -4
index 5ed925d..c830817 100644
@@ -166,10 +166,13 @@ static void cdrom_analyze_sense_data(ide_drive_t *drive,
 	unsigned long bio_sectors;
 	struct cdrom_info *info = drive->driver_data;
 
-	ide_debug_log(IDE_DBG_SENSE, "Call %s, failed cmd: 0x%x, "
-		      "error_code: 0x%x, sense_key: 0x%x\n",
-		      __func__, failed_command->cmd[0], sense->error_code,
-		      sense->sense_key);
+	ide_debug_log(IDE_DBG_SENSE, "Call %s, error_code: 0x%x, "
+			"sense_key: 0x%x\n", __func__, sense->error_code,
+			sense->sense_key);
+
+	if (failed_command)
+		ide_debug_log(IDE_DBG_SENSE, "%s: failed cmd: 0x%x\n",
+				__func__, failed_command->cmd[0]);
 
 	if (!cdrom_log_sense(drive, failed_command, sense))
 		return;
Signature · 5 lines
1.5.5.4

-- 
Regards/Gruss,
    Boris.
#1 lore raw
Quoted 4 lines · Borislav Petkov

Hi Bart,

here's another null ptr fix in the debugging code. I'll be auditing all the debug fragments in case I've missed some.

also merged into the original patch