diff options
author | Tejun Heo <htejun@gmail.com> | 2007-01-02 06:19:40 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-02-09 17:39:30 -0500 |
commit | 8bfa79fcb81d2bdb043f60ab4171704467808b55 (patch) | |
tree | 8b81b15237110ee30626057541e07b0ba8aa80bc /drivers/ata/pata_ali.c | |
parent | a0cf733b333eeeafb7324e2897448006c693c26c (diff) |
libata: use ata_id_c_string()
There were several places where ATA ID strings are manually terminated
and in some places possibly unterminated strings were passed to string
functions which don't limit length like strstr(). This patch converts
all of them over to ata_id_c_string().
Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/ata/pata_ali.c')
-rw-r--r-- | drivers/ata/pata_ali.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/ata/pata_ali.c b/drivers/ata/pata_ali.c index 76e386043dcd..fde5ce9f7eae 100644 --- a/drivers/ata/pata_ali.c +++ b/drivers/ata/pata_ali.c | |||
@@ -153,11 +153,11 @@ static void ali_early_error_handler(struct ata_port *ap) | |||
153 | 153 | ||
154 | static unsigned long ali_20_filter(const struct ata_port *ap, struct ata_device *adev, unsigned long mask) | 154 | static unsigned long ali_20_filter(const struct ata_port *ap, struct ata_device *adev, unsigned long mask) |
155 | { | 155 | { |
156 | char model_num[ATA_ID_PROD_LEN]; | 156 | char model_num[ATA_ID_PROD_LEN + 1]; |
157 | /* No DMA on anything but a disk for now */ | 157 | /* No DMA on anything but a disk for now */ |
158 | if (adev->class != ATA_DEV_ATA) | 158 | if (adev->class != ATA_DEV_ATA) |
159 | mask &= ~(ATA_MASK_MWDMA | ATA_MASK_UDMA); | 159 | mask &= ~(ATA_MASK_MWDMA | ATA_MASK_UDMA); |
160 | ata_id_string(adev->id, model_num, ATA_ID_PROD, sizeof(model_num)); | 160 | ata_id_c_string(adev->id, model_num, ATA_ID_PROD, sizeof(model_num)); |
161 | if (strstr(model_num, "WDC")) | 161 | if (strstr(model_num, "WDC")) |
162 | return mask &= ~ATA_MASK_UDMA; | 162 | return mask &= ~ATA_MASK_UDMA; |
163 | return ata_pci_default_filter(ap, adev, mask); | 163 | return ata_pci_default_filter(ap, adev, mask); |