aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide
diff options
context:
space:
mode:
authorTejun Heo <tj@home-tj.org>2007-11-05 15:42:25 -0500
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-11-05 15:42:25 -0500
commit699b052ad2996c4ca87aa4b9d4a51dcca0f9e588 (patch)
treee020540447b1ccb81b409d16e4caa80bc7dd9c76 /drivers/ide
parentafda5e4da5abf7366ba8ac49e7634b3c85a143ae (diff)
ide: do_identify() string termination fix
Terminates id->model string before invoking strstr() in do_identify(). Signed-off-by: Tejun Heo <tj@home-tj.org> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide')
-rw-r--r--drivers/ide/ide-probe.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
index 6a6f2e066b46..56fb0b843429 100644
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -172,11 +172,12 @@ static inline void do_identify (ide_drive_t *drive, u8 cmd)
172 ide_fixstring(id->fw_rev, sizeof(id->fw_rev), bswap); 172 ide_fixstring(id->fw_rev, sizeof(id->fw_rev), bswap);
173 ide_fixstring(id->serial_no, sizeof(id->serial_no), bswap); 173 ide_fixstring(id->serial_no, sizeof(id->serial_no), bswap);
174 174
175 /* we depend on this a lot! */
176 id->model[sizeof(id->model)-1] = '\0';
177
175 if (strstr(id->model, "E X A B Y T E N E S T")) 178 if (strstr(id->model, "E X A B Y T E N E S T"))
176 goto err_misc; 179 goto err_misc;
177 180
178 /* we depend on this a lot! */
179 id->model[sizeof(id->model)-1] = '\0';
180 printk("%s: %s, ", drive->name, id->model); 181 printk("%s: %s, ", drive->name, id->model);
181 drive->present = 1; 182 drive->present = 1;
182 drive->dead = 0; 183 drive->dead = 0;