Re: [PATCH v8 3/5] rxrpc: check return value of skb_to_sgvec always

From: David Howells
Date: Mon May 15 2017 - 09:11:30 EST


Jason A. Donenfeld <Jason@xxxxxxxxx> wrote:

> + if (unlikely(skb_to_sgvec(skb, sg, offset, 8) < 0))
> + goto nomem;
> ...
> + if (unlikely(skb_to_sgvec(skb, sg, offset, len) < 0)) {
> + if (sg != _sg)
> + kfree(sg);
> + goto nomem;

skb_to_sgvec() can return -EMSGSIZE in some circumstances. You shouldn't
return -ENOMEM here in such a case.

David