From: Andy Shevchenko <hidden> Date: 2021-05-10 09:58:24
In each iteration fwnode_for_each_available_child_node() bumps a reference
counting of a loop variable followed by dropping in on a next iteration,
Since in error case the loop is broken, we have to drop a reference count
by ourselves. Do it for port_fwnode in error case during ->probe().
Fixes: 248122212f68 ("net: mvpp2: use device_*/fwnode_* APIs instead of of_*")
Cc: Marcin Wojtas <redacted>
Signed-off-by: Andy Shevchenko <redacted>
---
drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 2 ++
1 file changed, 2 insertions(+)
From: Andy Shevchenko <hidden> Date: 2021-05-10 09:58:26
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Use the device_get_match_data() helper instead of open coding.
Signed-off-by: Andy Shevchenko <redacted>
---
drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 12 +-----------
1 file changed, 1 insertion(+), 11 deletions(-)
@@ -7311,7 +7311,6 @@ static int mvpp2_get_sram(struct platform_device *pdev,staticintmvpp2_probe(structplatform_device*pdev){-conststructacpi_device_id*acpi_id;structfwnode_handle*fwnode=pdev->dev.fwnode;structfwnode_handle*port_fwnode;structmvpp2*priv;
@@ -7324,16 +7323,7 @@ static int mvpp2_probe(struct platform_device *pdev)if(!priv)return-ENOMEM;-if(has_acpi_companion(&pdev->dev)){-acpi_id=acpi_match_device(pdev->dev.driver->acpi_match_table,-&pdev->dev);-if(!acpi_id)-return-EINVAL;-priv->hw_version=(unsignedlong)acpi_id->driver_data;-}else{-priv->hw_version=-(unsignedlong)of_device_get_match_data(&pdev->dev);-}+priv->hw_version=(unsignedlong)device_get_match_data(&pdev->dev);/* multi queue mode isn't supported on PPV2.1, fallback to single*mode
From: Andy Shevchenko <hidden> Date: 2021-05-10 09:58:29
device_property_read_u32() may return different error codes.
Propagate it to the caller.
Signed-off-by: Andy Shevchenko <redacted>
---
drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
Hello:
This series was applied to netdev/net-next.git (refs/heads/master):
On Mon, 10 May 2021 12:58:05 +0300 you wrote:
In each iteration fwnode_for_each_available_child_node() bumps a reference
counting of a loop variable followed by dropping in on a next iteration,
Since in error case the loop is broken, we have to drop a reference count
by ourselves. Do it for port_fwnode in error case during ->probe().
Fixes: 248122212f68 ("net: mvpp2: use device_*/fwnode_* APIs instead of of_*")
Cc: Marcin Wojtas <redacted>
Signed-off-by: Andy Shevchenko <redacted>
[...]