fpga: dfl: fme: add error handling
Subsystems (2)
PATCH 1/1 fpga: dfl: fme: add error handling
From: Griffin Kroah-Hartman <[email protected]>
Add error handling to devm_kasprint in fme_perf_pmu_register().
Assisted-by gkh_clanker_2000
Cc stable <[email protected]>
Cc Xu Yilun <[email protected]>
Cc Tom Rix <[email protected]>
Cc Moritz Fischer <[email protected]>
Signed-off-by Griffin Kroah-Hartman <[email protected]>
Signed-off-by Greg Kroah-Hartman <[email protected]>
--- drivers/fpga/dfl-fme-perf.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/fpga/dfl-fme-perf.c +2 -0
@@ -925,6 +925,8 @@ static int fme_perf_pmu_register(struct platform_device *pdev,PERF_PMU_CAP_NO_EXCLUDE ; name =devm_kasprintf (priv->dev,GFP_KERNEL ,"dfl_fme%d" , pdev->id); +if (!name) +return -ENOMEM ; ret =perf_pmu_register (pmu, name,-1 );if (ret)
Signature · 1 line
2.55.0
Quoted 3 lines · Greg Kroah-Hartman
From: Griffin Kroah-Hartman <[email protected]>
Add error handling to
devm_kasprintinfme_perf_pmu_register().
Actually perf_pmu_register() will handle the !name, but good to change it for readability.
Quoted 2 lines
Assisted-by gkh_clanker_2000
Fixes 724142f8c42a ("fpga: dfl: fme: add performance reporting support")
Quoted 1 line
Cc stable <[email protected]>
Changed to Cc: [email protected], or checkpatch will complain.
Quoted 5 lines
Cc Xu Yilun <[email protected]>Cc Tom Rix <[email protected]>Cc Moritz Fischer <[email protected]>Signed-off-by Griffin Kroah-Hartman <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>
Reviewed-by Xu Yilun <[email protected]>
I fixed the tags inplace, and applied to for-next.
Thanks,
Yilun
Quoted 21 lines
--- drivers/fpga/dfl-fme-perf.c | 2 ++ 1 file changed, 2 insertions(+)drivers/fpga/dfl-fme-perf.c +2
-0@@ -925,6 +925,8 @@ static int fme_perf_pmu_register(struct platform_device *pdev,PERF_PMU_CAP_NO_EXCLUDE ; name =devm_kasprintf (priv->dev,GFP_KERNEL ,"dfl_fme%d" , pdev->id); +if (!name) +return -ENOMEM ; ret =perf_pmu_register (pmu, name,-1 );if (ret)Signature · 1 line
2.55.0