Re: [PATCH bpf-next] xsk: fix xsk_build_skb() error: 'skb' dereferencing possible ERR_PTR()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 08/10, Tirthendu Sarkar wrote:
> xsk_build_skb_zerocopy() may return an error other than -EAGAIN and this
> is received as skb and used later in xsk_set_destructor_arg() and
> xsk_drop_skb() which must operate on a valid skb.
> 
> Add new parameter to xsk_build_skb_zerocopy() to explicitly return error
> and invoke xsk_set_destructor_arg() and xsk_drop_skb() only for a valid
> skb.

Maybe I'm missing something, but seems more complex that it should.
Why not do the following instead?

	} else if (!IS_ERR(skb)) {
  		xsk_set_destructor_arg(skb);
  		xsk_drop_skb(skb);
  		xskq_cons_release(xs->tx);
	}

Why do we need to separate the err?




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux