Re: [PATCH for-next 2/7] RDMA/bnxt_re: Replace chip context structure with pointer

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

 



On Fri, Jan 24, 2020 at 12:52:40AM -0500, Devesh Sharma wrote:
>  static void bnxt_re_destroy_chip_ctx(struct bnxt_re_dev *rdev)
>  {
> +	struct bnxt_qplib_chip_ctx *chip_ctx;
> +
> +	if (!rdev->chip_ctx)
> +		return;
> +	chip_ctx = rdev->chip_ctx;
> +	rdev->chip_ctx = NULL;
>  	rdev->rcfw.res = NULL;
>  	rdev->qplib_res.cctx = NULL;
> +	kfree(chip_ctx);
>  }

Are you sure this kfree is late enough? I couldn't deduce if it was
really safe to NULL chip_ctx here.

IMHO you should free it as part of the ib device dealloc.

Jason




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux