mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
nfs: add kmalloc return value check in decode_and_add_ds
add kmalloc return value check in decode_and_add_ds Signed-off-by: Stanislav Fomichev <kernel@fomichev.me> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
This commit is contained in:
parent
a5e5026810
commit
b9f810570d
1 changed files with 4 additions and 0 deletions
|
@ -219,6 +219,10 @@ decode_and_add_ds(__be32 **pp, struct inode *inode)
|
|||
goto out_err;
|
||||
}
|
||||
buf = kmalloc(rlen + 1, GFP_KERNEL);
|
||||
if (!buf) {
|
||||
dprintk("%s: Not enough memory\n", __func__);
|
||||
goto out_err;
|
||||
}
|
||||
buf[rlen] = '\0';
|
||||
memcpy(buf, r_addr, rlen);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue