lkml.org 
[lkml]   [2018]   [Mar]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH net-next] net: mvpp2: Don't use dynamic allocs for local variables
Hi Maxime,

On Tue, Mar 20, 2018 at 04:34:08PM +0100, Maxime Chevallier wrote:
> @@ -2416,36 +2393,36 @@ static int mvpp2_prs_double_vlan_add(struct mvpp2 *priv, unsigned short tpid1,
> }
>
> if (tid >= tid_aux) {
> - ret = -ERANGE;
> - goto free_pe;
> + return -ERANGE;
> }

You can remove the brackets here.

> @@ -3833,39 +3804,39 @@ static int mvpp2_prs_mac_da_accept(struct mvpp2_port *port, const u8 *da,

[...]

> /* Invalidate the entry if no ports are left enabled */
> - pmap = mvpp2_prs_tcam_port_map_get(pe);
> + pmap = mvpp2_prs_tcam_port_map_get(&pe);
> if (pmap == 0) {
> if (add) {
> - kfree(pe);
> return -EINVAL;
> }

And here.

Thanks!
Antoine

--
Antoine Ténart, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

\
 
 \ /
  Last update: 2018-03-20 18:57    [W:0.028 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site