diff options
author | Markus Elfring <elfring@users.sourceforge.net> | 2017-01-13 09:46:35 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2017-01-17 13:35:06 -0500 |
commit | baa35f5734aa1c0207e4e6b8e15079475b1fa252 (patch) | |
tree | a4c48f4b29cf480d6dbef154752e84fb3f651455 | |
parent | 84aa0ba12442fa46f461c491c42efdadf6995c96 (diff) |
spi/topcliff-pch: Improve size determinations in pch_spi_probe()
Replace the specification of data structures by pointer dereferences
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | drivers/spi/spi-topcliff-pch.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/spi/spi-topcliff-pch.c b/drivers/spi/spi-topcliff-pch.c index 1beeb16e836a..0a876311b67b 100644 --- a/drivers/spi/spi-topcliff-pch.c +++ b/drivers/spi/spi-topcliff-pch.c | |||
@@ -1539,11 +1539,11 @@ static int pch_spi_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||
1539 | int i; | 1539 | int i; |
1540 | struct pch_pd_dev_save *pd_dev_save; | 1540 | struct pch_pd_dev_save *pd_dev_save; |
1541 | 1541 | ||
1542 | pd_dev_save = kzalloc(sizeof(struct pch_pd_dev_save), GFP_KERNEL); | 1542 | pd_dev_save = kzalloc(sizeof(*pd_dev_save), GFP_KERNEL); |
1543 | if (!pd_dev_save) | 1543 | if (!pd_dev_save) |
1544 | return -ENOMEM; | 1544 | return -ENOMEM; |
1545 | 1545 | ||
1546 | board_dat = kzalloc(sizeof(struct pch_spi_board_data), GFP_KERNEL); | 1546 | board_dat = kzalloc(sizeof(*board_dat), GFP_KERNEL); |
1547 | if (!board_dat) { | 1547 | if (!board_dat) { |
1548 | retval = -ENOMEM; | 1548 | retval = -ENOMEM; |
1549 | goto err_no_mem; | 1549 | goto err_no_mem; |