lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Fri, 15 Jan 2021 13:02:30 +0100 From: Alexandre Belloni <alexandre.belloni@...tlin.com> To: Vladimir Oltean <olteanv@...il.com> Cc: Vladimir Oltean <vladimir.oltean@....com>, Tobias Waldekranz <tobias@...dekranz.com>, "David S . Miller" <davem@...emloft.net>, Jakub Kicinski <kuba@...nel.org>, netdev@...r.kernel.org, UNGLinuxDriver@...rochip.com, Andrew Lunn <andrew@...n.ch>, Florian Fainelli <f.fainelli@...il.com>, Vivien Didelot <vivien.didelot@...il.com>, Claudiu Manoil <claudiu.manoil@....com> Subject: Re: [RFC PATCH net-next 12/16] net: mscc: ocelot: drop the use of the "lags" array On 15/01/2021 13:05:47+0200, Vladimir Oltean wrote: > > -static void ocelot_set_aggr_pgids(struct ocelot *ocelot) > > +static int ocelot_set_aggr_pgids(struct ocelot *ocelot) > > { > > + struct net_device **bonds; > > int i, port, lag; > > > > + bonds = kcalloc(ocelot->num_phys_ports, sizeof(struct net_device *), > > + GFP_KERNEL); > > + if (!bonds) > > + return -ENOMEM; > > + > > I remember somebody complaining about the temporary memory allocation > done here, but I can't seem to find that email for some reason. > > Is it ok if I still keep the dynamic allocation there, though? Felix has > up to 5 user ports, Seville has up to 9, Ocelot up to 11. I would like > to not hardcode anything, in case (who knows!) more switches get added. > I was probably the one, the main reason being that this make this function able to fail. Removing the dynamic allocation would ensure it never fails. However, I didn't suggest any other solution so I'm fine if you keep it. -- Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
Powered by blists - more mailing lists