projects
/
GitHub
/
moto-9609
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1980eb9
)
sata_sx4: correctly handling failed allocation
author
Insu Yun
<wuninsu@gmail.com>
Tue, 29 Dec 2015 21:21:15 +0000
(16:21 -0500)
committer
Tejun Heo
<tj@kernel.org>
Fri, 1 Jan 2016 02:33:42 +0000
(21:33 -0500)
Since kzalloc can be failed in memory pressure, return error when failed.
Signed-off-by: Insu Yun <wuninsu@gmail.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
drivers/ata/sata_sx4.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/ata/sata_sx4.c
b/drivers/ata/sata_sx4.c
index fab504fd9cfd7ace54d772927a01650373d02206..48301cb3a3165a189981764b6fea81a87cbdb858 100644
(file)
--- 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);