Re: [PATCH bpf-next v7 19/26] bpf: Permit NULL checking pointer with non-zero fixed offset

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

 



On Tue, Nov 15, 2022 at 12:45:40AM +0530, Kumar Kartikeya Dwivedi wrote:
>  	if (type_may_be_null(reg->type) && reg->id == id &&
>  	    !WARN_ON_ONCE(!reg->id)) {
> -		if (WARN_ON_ONCE(reg->smin_value || reg->smax_value ||
> -				 !tnum_equals_const(reg->var_off, 0) ||
> -				 reg->off)) {
> +		if (reg->smin_value || reg->smax_value || !tnum_equals_const(reg->var_off, 0) || reg->off) {
....
> +			if (WARN_ON_ONCE(reg->smin_value || reg->smax_value || !tnum_equals_const(reg->var_off, 0)))

That is too much copy-paste between two lines.
Please combine the checks.



[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