Skip to content

Commit

Permalink
Merge tag 'edac_urgent_for_v6.2_rc4' of git://git.kernel.org/pub/scm/…
Browse files Browse the repository at this point in the history
…linux/kernel/git/ras/ras

Pull EDAC fixes from Borislav Petkov:

 - Fix the EDAC device's confusion in the polling setting units

 - Fix a memory leak in highbank's probing function

* tag 'edac_urgent_for_v6.2_rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras:
  EDAC/highbank: Fix memory leak in highbank_mc_probe()
  EDAC/device: Fix period calculation in edac_device_reset_delay_period()
  • Loading branch information
Linus Torvalds committed Jan 15, 2023
2 parents b1d63f0 + e7a2936 commit 8aa9761
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
17 changes: 8 additions & 9 deletions drivers/edac/edac_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -394,17 +394,16 @@ static void edac_device_workq_teardown(struct edac_device_ctl_info *edac_dev)
* Then restart the workq on the new delay
*/
void edac_device_reset_delay_period(struct edac_device_ctl_info *edac_dev,
unsigned long value)
unsigned long msec)
{
unsigned long jiffs = msecs_to_jiffies(value);

if (value == 1000)
jiffs = round_jiffies_relative(value);

edac_dev->poll_msec = value;
edac_dev->delay = jiffs;
edac_dev->poll_msec = msec;
edac_dev->delay = msecs_to_jiffies(msec);

edac_mod_work(&edac_dev->work, jiffs);
/* See comment in edac_device_workq_setup() above */
if (edac_dev->poll_msec == 1000)
edac_mod_work(&edac_dev->work, round_jiffies_relative(edac_dev->delay));
else
edac_mod_work(&edac_dev->work, edac_dev->delay);
}

int edac_device_alloc_index(void)
Expand Down
2 changes: 1 addition & 1 deletion drivers/edac/edac_module.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ bool edac_stop_work(struct delayed_work *work);
bool edac_mod_work(struct delayed_work *work, unsigned long delay);

extern void edac_device_reset_delay_period(struct edac_device_ctl_info
*edac_dev, unsigned long value);
*edac_dev, unsigned long msec);
extern void edac_mc_reset_delay_period(unsigned long value);

/*
Expand Down
7 changes: 5 additions & 2 deletions drivers/edac/highbank_mc_edac.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,10 @@ static int highbank_mc_probe(struct platform_device *pdev)
drvdata = mci->pvt_info;
platform_set_drvdata(pdev, mci);

if (!devres_open_group(&pdev->dev, NULL, GFP_KERNEL))
return -ENOMEM;
if (!devres_open_group(&pdev->dev, NULL, GFP_KERNEL)) {
res = -ENOMEM;
goto free;
}

r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!r) {
Expand Down Expand Up @@ -243,6 +245,7 @@ static int highbank_mc_probe(struct platform_device *pdev)
edac_mc_del_mc(&pdev->dev);
err:
devres_release_group(&pdev->dev, NULL);
free:
edac_mc_free(mci);
return res;
}
Expand Down

0 comments on commit 8aa9761

Please sign in to comment.