lkml.org 
[lkml]   [2008]   [Sep]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
Subject[PATCH] ide-cd: fix debug printk
From
Hi Bart,

please apply.
---
From: Borislav Petkov <petkovbb@gmail.com>
Date: Fri, 19 Sep 2008 19:30:46 +0200
Subject: [PATCH] ide-cd: fix debug printk

failed_command can be NULL so check it before accessing it.

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
---
drivers/ide/ide-cd.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
index 3fdf660..5ed925d 100644
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -221,6 +221,8 @@ static void cdrom_queue_request_sense(ide_drive_t *drive, void *sense,
struct cdrom_info *info = drive->driver_data;
struct request *rq = &info->request_sense_request;

+ ide_debug_log(IDE_DBG_SENSE, "Call %s\n", __func__);
+
if (sense == NULL)
sense = &info->sense_data;

@@ -240,8 +242,9 @@ static void cdrom_queue_request_sense(ide_drive_t *drive, void *sense,
/* NOTE! Save the failed command in "rq->buffer" */
rq->buffer = (void *) failed_command;

- ide_debug_log(IDE_DBG_SENSE, "Call %s, failed_cmd: 0x%x\n", __func__,
- failed_command->cmd[0]);
+ if (failed_command)
+ ide_debug_log(IDE_DBG_SENSE, "failed_cmd: 0x%x\n",
+ failed_command->cmd[0]);

ide_do_drive_cmd(drive, rq);
}
--
1.5.5.1
--
Regards/Gruss,
Boris.


\
 
 \ /
  Last update: 2008-09-19 19:41    [W:0.050 / U:0.540 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site