OSDN Git Service

fsl/fman: remove wrong free
authorMadalin Bucur <madalin.bucur@nxp.com>
Mon, 13 Feb 2017 15:10:46 +0000 (17:10 +0200)
committerMadalin Bucur <madalin.bucur@nxp.com>
Thu, 9 Mar 2017 06:54:04 +0000 (08:54 +0200)
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Madalin Bucur <madalin.bucur@nxp.com>
drivers/net/ethernet/freescale/fman/fman_port.c

index f314348..57bf44f 100644 (file)
@@ -1312,7 +1312,7 @@ int fman_port_config(struct fman_port *port, struct fman_port_params *params)
        /* Allocate the FM driver's parameters structure */
        port->cfg = kzalloc(sizeof(*port->cfg), GFP_KERNEL);
        if (!port->cfg)
-               goto err_params;
+               return -EINVAL;
 
        /* Initialize FM port parameters which will be kept by the driver */
        port->port_type = port->dts_params.type;
@@ -1393,8 +1393,6 @@ int fman_port_config(struct fman_port *port, struct fman_port_params *params)
 
 err_port_cfg:
        kfree(port->cfg);
-err_params:
-       kfree(port);
        return -EINVAL;
 }
 EXPORT_SYMBOL(fman_port_config);