mirror of
https://github.com/torvalds/linux.git
synced 2024-11-24 13:11:40 +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
@ -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…
Reference in New Issue
Block a user