* [PATCH] ata: correctly handling failed allocation
@ 2015-12-29 21:21 Insu Yun
2016-01-01 2:34 ` Tejun Heo
0 siblings, 1 reply; 2+ messages in thread
From: Insu Yun @ 2015-12-29 21:21 UTC (permalink / raw)
To: tj, linux-ide, linux-kernel
Cc: taesoo, yeongjin.jang, insu, changwoo, Insu Yun
Since kzalloc can be failed in memory pressure, return error when failed.
Signed-off-by: Insu Yun <wuninsu@gmail.com>
---
drivers/ata/sata_sx4.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/ata/sata_sx4.c b/drivers/ata/sata_sx4.c
index fab504f..48301cb 100644
--- a/drivers/ata/sata_sx4.c
+++ b/drivers/ata/sata_sx4.c
@@ -1396,6 +1396,8 @@ static unsigned int pdc20621_dimm_init(struct ata_host *host)
addr = 0;
length = size * 1024 * 1024;
buf = kzalloc(ECC_ERASE_BUF_SZ, GFP_KERNEL);
+ if (!buf)
+ return 1;
while (addr < length) {
pdc20621_put_to_dimm(host, buf, addr,
ECC_ERASE_BUF_SZ);
--
1.9.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] ata: correctly handling failed allocation
2015-12-29 21:21 [PATCH] ata: correctly handling failed allocation Insu Yun
@ 2016-01-01 2:34 ` Tejun Heo
0 siblings, 0 replies; 2+ messages in thread
From: Tejun Heo @ 2016-01-01 2:34 UTC (permalink / raw)
To: Insu Yun; +Cc: linux-ide, linux-kernel, taesoo, yeongjin.jang, insu, changwoo
On Tue, Dec 29, 2015 at 04:21:15PM -0500, Insu Yun wrote:
> Since kzalloc can be failed in memory pressure, return error when failed.
>
> Signed-off-by: Insu Yun <wuninsu@gmail.com>
Applied to libata/for-4.5.
Thanks.
--
tejun
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-01-01 2:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-29 21:21 [PATCH] ata: correctly handling failed allocation Insu Yun
2016-01-01 2:34 ` Tejun Heo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome