diff options
Diffstat (limited to 'drivers/scsi/scsi_transport_spi.c')
-rw-r--r-- | drivers/scsi/scsi_transport_spi.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/scsi/scsi_transport_spi.c b/drivers/scsi/scsi_transport_spi.c index 7ee95eb83dda..a1e521b58b67 100644 --- a/drivers/scsi/scsi_transport_spi.c +++ b/drivers/scsi/scsi_transport_spi.c | |||
@@ -900,13 +900,11 @@ spi_dv_device(struct scsi_device *sdev) | |||
900 | if (unlikely(scsi_device_get(sdev))) | 900 | if (unlikely(scsi_device_get(sdev))) |
901 | return; | 901 | return; |
902 | 902 | ||
903 | buffer = kmalloc(len, GFP_KERNEL); | 903 | buffer = kzalloc(len, GFP_KERNEL); |
904 | 904 | ||
905 | if (unlikely(!buffer)) | 905 | if (unlikely(!buffer)) |
906 | goto out_put; | 906 | goto out_put; |
907 | 907 | ||
908 | memset(buffer, 0, len); | ||
909 | |||
910 | /* We need to verify that the actual device will quiesce; the | 908 | /* We need to verify that the actual device will quiesce; the |
911 | * later target quiesce is just a nice to have */ | 909 | * later target quiesce is just a nice to have */ |
912 | if (unlikely(scsi_device_quiesce(sdev))) | 910 | if (unlikely(scsi_device_quiesce(sdev))) |
@@ -1265,15 +1263,13 @@ static DECLARE_ANON_TRANSPORT_CLASS(spi_device_class, | |||
1265 | struct scsi_transport_template * | 1263 | struct scsi_transport_template * |
1266 | spi_attach_transport(struct spi_function_template *ft) | 1264 | spi_attach_transport(struct spi_function_template *ft) |
1267 | { | 1265 | { |
1268 | struct spi_internal *i = kmalloc(sizeof(struct spi_internal), | ||
1269 | GFP_KERNEL); | ||
1270 | int count = 0; | 1266 | int count = 0; |
1267 | struct spi_internal *i = kzalloc(sizeof(struct spi_internal), | ||
1268 | GFP_KERNEL); | ||
1269 | |||
1271 | if (unlikely(!i)) | 1270 | if (unlikely(!i)) |
1272 | return NULL; | 1271 | return NULL; |
1273 | 1272 | ||
1274 | memset(i, 0, sizeof(struct spi_internal)); | ||
1275 | |||
1276 | |||
1277 | i->t.target_attrs.ac.class = &spi_transport_class.class; | 1273 | i->t.target_attrs.ac.class = &spi_transport_class.class; |
1278 | i->t.target_attrs.ac.attrs = &i->attrs[0]; | 1274 | i->t.target_attrs.ac.attrs = &i->attrs[0]; |
1279 | i->t.target_attrs.ac.match = spi_target_match; | 1275 | i->t.target_attrs.ac.match = spi_target_match; |