Thread (9 messages) flat view 9 messages, 2 authors, 2024-01-19

Re: [PATCH net v5 2/4] dpll: fix pin dump crash for rebound module

From: Jiri Pirko <jiri@resnulli.us>
Date: 2024-01-18 11:44:09
Also in: lkml

Thu, Jan 18, 2024 at 12:07:17PM CET, arkadiusz.kubalewski@intel.com wrote:

[...]
quoted hunk ↗ jump to hunk
@@ -443,7 +490,9 @@ dpll_pin_alloc(u64 clock_id, u32 pin_idx, struct module *module,
		ret = -EINVAL;
		goto err_pin_prop;
	}
-	pin->prop = prop;
+	ret = dpll_pin_prop_dup(prop, &pin->prop);
+	if (ret)
+		goto err_pin_prop;
	refcount_set(&pin->refcount, 1);
	xa_init_flags(&pin->dpll_refs, XA_FLAGS_ALLOC);
	xa_init_flags(&pin->parent_refs, XA_FLAGS_ALLOC);
You are missing dpll_pin_prop_free() call on error path. It should go
right above "err_pin_prop:" line.

Haste makes waste..

pw-bot: cr


quoted hunk ↗ jump to hunk
@@ -515,6 +564,7 @@ void dpll_pin_put(struct dpll_pin *pin)
		xa_destroy(&pin->dpll_refs);
		xa_destroy(&pin->parent_refs);
		xa_erase(&dpll_pin_xa, pin->id);
+		dpll_pin_prop_free(&pin->prop);
To be symmetric with dpll_pin_alloc() order, xa_erase() should be called
first here and xa_destroys() in different order. But that is a material
for net-next.


		kfree(pin);
	}
	mutex_unlock(&dpll_lock);
[...]
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help