netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
To: Faiz Abbas <faiz_abbas-l0cyMroinI0@public.gmane.org>,
	wg-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	mark.rutland-5wv7dgnIgG8@public.gmane.org
Cc: linux-can-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	nsekhar-l0cyMroinI0@public.gmane.org,
	fcooper-l0cyMroinI0@public.gmane.org,
	robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	Wenyou.Yang-UWL1GkI3JZL3oGB3hsPCZA@public.gmane.org,
	sergei.shtylyov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org,
	linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	b29396-KZfg59tc24xl57MIdRCFDg@public.gmane.org
Subject: Re: [PATCH v7 4/8] can: m_can: Move allocation of net device to probe
Date: Mon, 15 Jan 2018 14:52:35 +0100	[thread overview]
Message-ID: <480602fa-db66-d5c3-056c-e61e5d0f2afa@pengutronix.de> (raw)
In-Reply-To: <1515581725-29242-5-git-send-email-faiz_abbas-l0cyMroinI0@public.gmane.org>


[-- Attachment #1.1: Type: text/plain, Size: 995 bytes --]

On 01/10/2018 11:55 AM, Faiz Abbas wrote:
> With the version no longer required to allocate the net device, it can
> be moved to probe and the alloc_m_can_dev() function can be simplified.
> 
> Therefore, move the allocation of net device to probe and change
> alloc_m_can_dev() to setup_m_can_dev().

The error handling is broken with this patch,

Have a look at the switch (priv->version) in setup_m_can_dev(), you free
the m_can_dev in case of error, but exit with -EINVAL in the beginning
of the function. setup_m_can_dev() should not free if it doesn't allocate.

The error handling in m_can_plat_probe() is broken, too. If
pm_runtime_get_sync(&pdev->dev) fails, you don't free the candev.

Marc

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  parent reply	other threads:[~2018-01-15 13:52 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-10 10:55 [PATCH v7 0/8] Add MCAN Support for Dra76 platform Faiz Abbas
2018-01-10 10:55 ` [PATCH v7 2/8] can: m_can: Add call to of_can_transceiver Faiz Abbas
2018-01-10 10:55 ` [PATCH v7 3/8] can: m_can: Remove check for version when allocating m_can net device Faiz Abbas
2018-01-10 10:55 ` [PATCH v7 4/8] can: m_can: Move allocation of net device to probe Faiz Abbas
     [not found]   ` <1515581725-29242-5-git-send-email-faiz_abbas-l0cyMroinI0@public.gmane.org>
2018-01-15 13:52     ` Marc Kleine-Budde [this message]
2018-01-16  9:03       ` Faiz Abbas
2018-01-10 10:55 ` [PATCH v7 5/8] can: m_can: Add PM Support Faiz Abbas
2018-01-15 13:55   ` Marc Kleine-Budde
2018-01-16 11:05     ` Faiz Abbas
2018-01-10 10:55 ` [PATCH v7 6/8] can: m_can: Support higher speed CAN-FD bitrates Faiz Abbas
2018-01-10 10:55 ` [PATCH v7 7/8] dt-bindings: can: m_can: Document new can transceiver binding Faiz Abbas
2018-01-11 20:20   ` Rob Herring
2018-01-12  6:24     ` Faiz Abbas
2018-01-10 10:55 ` [PATCH v7 8/8] dt-bindings: can: can-transceiver: Document new binding Faiz Abbas
     [not found] ` <1515581725-29242-1-git-send-email-faiz_abbas-l0cyMroinI0@public.gmane.org>
2018-01-10 10:55   ` [PATCH v7 1/8] can: dev: Add support for limiting configured bitrate Faiz Abbas
2018-01-15 13:40     ` Marc Kleine-Budde
2018-01-15 14:44   ` [PATCH v7 0/8] Add MCAN Support for Dra76 platform Marc Kleine-Budde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=480602fa-db66-d5c3-056c-e61e5d0f2afa@pengutronix.de \
    --to=mkl-bicnvbalz9megne8c9+irq@public.gmane.org \
    --cc=Wenyou.Yang-UWL1GkI3JZL3oGB3hsPCZA@public.gmane.org \
    --cc=b29396-KZfg59tc24xl57MIdRCFDg@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=faiz_abbas-l0cyMroinI0@public.gmane.org \
    --cc=fcooper-l0cyMroinI0@public.gmane.org \
    --cc=linux-can-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
    --cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=nsekhar-l0cyMroinI0@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=sergei.shtylyov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org \
    --cc=wg-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).