From: Madalin Bucur Date: Mon, 13 Feb 2017 15:10:46 +0000 (+0200) Subject: fsl/fman: remove wrong free X-Git-Tag: v4.12-rc1~108^2~454^2~7 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=226327b236c97c860fe644a409fc536da53d5a98;p=karo-tx-linux.git fsl/fman: remove wrong free Reported-by: Dan Carpenter Signed-off-by: Madalin Bucur --- diff --git a/drivers/net/ethernet/freescale/fman/fman_port.c b/drivers/net/ethernet/freescale/fman/fman_port.c index f314348b3387..57bf44fa16a1 100644 --- a/drivers/net/ethernet/freescale/fman/fman_port.c +++ b/drivers/net/ethernet/freescale/fman/fman_port.c @@ -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);