Message ID | 20200604235127.XZqAyQULA%akpm@linux-foundation.org |
---|---|
State | New |
Headers | show |
Series | + nilfs2-fix-null-pointer-dereference-at-nilfs_segctor_do_construct.patch added to -mm tree | expand |
--- a/kernel/relay.c~relay-handle-alloc_percpu-returning-null-in-relay_open +++ a/kernel/relay.c @@ -581,6 +581,11 @@ struct rchan *relay_open(const char *bas return NULL; chan->buf = alloc_percpu(struct rchan_buf *); + if (!chan->buf) { + kfree(chan); + return NULL; + } + chan->version = RELAYFS_CHANNEL_VERSION; chan->n_subbufs = n_subbufs; chan->subbuf_size = subbuf_size;