[lkml]   [2022]   [Apr]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH net-next v4 03/18] net: dsa: sja1105: reorder sja1105_first_entry_longer_than with memory allocation

On 4/15/2022 5:29 AM, Jakob Koschel wrote:
> From: Vladimir Oltean <>
> sja1105_first_entry_longer_than() does not make use of the full struct
> sja1105_gate_entry *e, just of e->interval which is set from the passed
> entry_time.
> This means that if there is a gate conflict, we have allocated e for
> nothing, just to free it later. Reorder the memory allocation and the
> function call, to avoid that and simplify the error unwind path.
> Signed-off-by: Vladimir Oltean <>
> Signed-off-by: Jakob Koschel <>

Reviewed-by: Florian Fainelli <>

 \ /
  Last update: 2022-04-16 21:40    [W:0.087 / U:5.872 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site