diff options
author | Tejun Heo <tj@home-tj.org> | 2007-11-05 21:42:25 +0100 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2007-11-05 21:42:25 +0100 |
commit | 699b052ad2996c4ca87aa4b9d4a51dcca0f9e588 (patch) | |
tree | e020540447b1ccb81b409d16e4caa80bc7dd9c76 /drivers/ide/ide-probe.c | |
parent | afda5e4da5abf7366ba8ac49e7634b3c85a143ae (diff) | |
download | blackbird-op-linux-699b052ad2996c4ca87aa4b9d4a51dcca0f9e588.tar.gz blackbird-op-linux-699b052ad2996c4ca87aa4b9d4a51dcca0f9e588.zip |
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/ide-probe.c')
-rw-r--r-- | drivers/ide/ide-probe.c | 5 |
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) ide_fixstring(id->fw_rev, sizeof(id->fw_rev), bswap); ide_fixstring(id->serial_no, sizeof(id->serial_no), bswap); + /* we depend on this a lot! */ + id->model[sizeof(id->model)-1] = '\0'; + if (strstr(id->model, "E X A B Y T E N E S T")) goto err_misc; - /* we depend on this a lot! */ - id->model[sizeof(id->model)-1] = '\0'; printk("%s: %s, ", drive->name, id->model); drive->present = 1; drive->dead = 0; |