Skip to content

Commit f97f7d2

Browse files
committed
Merge tag 'spi-v3.10-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi
Pull spi updates from Mark Brown: "A few last minute SPI updates: fix a missized allocation and use atomic allocations in atomic context in the PXA driver, and fix the checking of return codes in the S3C64xx driver which caused spurious errors under heavy load." * tag 'spi-v3.10-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: spi/pxa2xx: fix memory corruption due to wrong size used in devm_kzalloc() spi/pxa2xx: use GFP_ATOMIC in sg table allocation spi: s3c64xx: Fix pm_runtime_get_sync() return value check
2 parents acdb37c + 332ec81 commit f97f7d2

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

drivers/spi/spi-pxa2xx-dma.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ static int pxa2xx_spi_map_dma_buffer(struct driver_data *drv_data,
5959
int ret;
6060

6161
sg_free_table(sgt);
62-
ret = sg_alloc_table(sgt, nents, GFP_KERNEL);
62+
ret = sg_alloc_table(sgt, nents, GFP_ATOMIC);
6363
if (ret)
6464
return ret;
6565
}

drivers/spi/spi-pxa2xx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1075,7 +1075,7 @@ pxa2xx_spi_acpi_get_pdata(struct platform_device *pdev)
10751075
acpi_bus_get_device(ACPI_HANDLE(&pdev->dev), &adev))
10761076
return NULL;
10771077

1078-
pdata = devm_kzalloc(&pdev->dev, sizeof(*ssp), GFP_KERNEL);
1078+
pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
10791079
if (!pdata) {
10801080
dev_err(&pdev->dev,
10811081
"failed to allocate memory for platform data\n");

drivers/spi/spi-s3c64xx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ static int s3c64xx_spi_prepare_transfer(struct spi_master *spi)
444444
}
445445

446446
ret = pm_runtime_get_sync(&sdd->pdev->dev);
447-
if (ret != 0) {
447+
if (ret < 0) {
448448
dev_err(dev, "Failed to enable device: %d\n", ret);
449449
goto out_tx;
450450
}

0 commit comments

Comments
 (0)