Commit 4030b278 authored by Namjae Jeon's avatar Namjae Jeon Committed by Steve French

cifsd: prevent a integer overflow in wm_alloc()

Dan Carpenter pointed out that there there is a possibility of
integer overflow. This patch prevent a integer overflow in wm_alloc().
Signed-off-by: default avatarNamjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent 9cca7516
......@@ -42,6 +42,9 @@ static struct wm *wm_alloc(size_t sz, gfp_t flags)
struct wm *wm;
size_t alloc_sz = sz + sizeof(struct wm);
if (sz > SIZE_MAX - sizeof(struct wm))
return NULL;
wm = kvmalloc(alloc_sz, flags);
if (!wm)
return NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment