Re: [PATCH net v5 1/3] net/smc: fix use-after-free of the LLC qentry in smc_llc_srv_add_link()

From: Breno Leitao

Date: Wed Aug 05 2026 - 10:01:12 EST


On Sat, Aug 01, 2026 at 06:42:06PM +0900, Yehyeong Lee wrote:
> @@ -1512,6 +1513,7 @@ int smc_llc_srv_add_link(struct smc_link *link,
> rc = smc_llc_srv_conf_link(link, link_new, lgr_new_t);
> if (rc)
> goto out_err;
> + kfree(qentry);
> kfree(ini);

Instead of these two kfree, can you just 'goto out' ? out: seems to do
the free nows, and rc is 0 above.

Also, is send_req_add_link_resp always false in smc_llc_srv_add_link() ?