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
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <da613453-7038-bcec-cdd5-7a8566a254b5@pengutronix.de>
Date:   Fri, 16 Oct 2020 09:44:44 +0200
From:   Marc Kleine-Budde <mkl@...gutronix.de>
To:     Joakim Zhang <qiangqing.zhang@....com>,
        "robh+dt@...nel.org" <robh+dt@...nel.org>,
        "shawnguo@...nel.org" <shawnguo@...nel.org>,
        "s.hauer@...gutronix.de" <s.hauer@...gutronix.de>
Cc:     "kernel@...gutronix.de" <kernel@...gutronix.de>,
        dl-linux-imx <linux-imx@....com>, Ying Liu <victor.liu@....com>,
        Peng Fan <peng.fan@....com>,
        "linux-can@...r.kernel.org" <linux-can@...r.kernel.org>,
        Pankaj Bansal <pankaj.bansal@....com>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 5/6] can: flexcan: add CAN wakeup function for i.MX8QM

On 10/16/20 8:46 AM, Joakim Zhang wrote:
>>> @@ -2019,6 +2109,7 @@ static int flexcan_probe(struct platform_device
>> *pdev)
>>>  	priv->clk_src = clk_src;
>>>  	priv->devtype_data = devtype_data;
>>>  	priv->reg_xceiver = reg_xceiver;
>>> +	priv->can_idx = can_idx;
>>>
>>>  	if (priv->devtype_data->quirks & FLEXCAN_QUIRK_SUPPORT_FD) {
>>>  		priv->can.ctrlmode_supported |= CAN_CTRLMODE_FD | @@
>> -2030,6
>>> +2121,10 @@ static int flexcan_probe(struct platform_device *pdev)
>>>  		priv->can.bittiming_const = &flexcan_bittiming_const;
>>>  	}
>>>
>>> +	err = flexcan_setup_stop_mode(pdev);
>>> +	if (err == -EPROBE_DEFER)
>>> +		return -EPROBE_DEFER;
>>
>> You need to free "dev". What about moving this directly before allocating dev.
>
> Yes, need free "dev" here if defer probe. Flexcan_priv has not allocated
> before allocating dev, but we need initialize and check it when setup stop
> mode.

Right, please take care of freeing all ressouces in case of defered probe.

>> Do you have to undo device_set_wakeup_capable() and
>> device_set_wakeup_enable() in case of a failure and/or on flexcan_remove()?
>
> Yes, should invoke device_wakeup_disable() in flexcan_remove.

Make it so.

regards,
Marc

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



Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ