Re: [PATCH bpf-next v2 3/6] netfilter: bpf: Prevent defrag module unload while link active

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

 



Daniel Xu <dxu@xxxxxxxxx> wrote:
> +		/* Prevent defrag module from going away while in use */
> +		if (!try_module_get(v4_hook->owner)) {
> +			err = -ENOENT;
> +			goto out_v4;
> +		}
> +
>  		err = v4_hook->enable(link->net);
>  out_v4:
>  		rcu_read_unlock();
> @@ -79,6 +86,12 @@ static int bpf_nf_enable_defrag(struct bpf_nf_link *link)
>  			}
>  		}
>  
> +		/* Prevent defrag module from going away while in use */
> +		if (!try_module_get(v6_hook->owner)) {
> +			err = -ENOENT;
> +			goto out_v6;
> +		}
> +
>  		err = v6_hook->enable(link->net);
>  out_v6:
>  		rcu_read_unlock();

This needs module_put() calls in case ->enable() returns an error, no?

Other than this this series LGTM, thanks!




[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