Skip to content

Commit 8aa9761

Browse files
committed
Merge tag 'edac_urgent_for_v6.2_rc4' of git://git.kernel.org/pub/scm/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()
2 parents b1d63f0 + e7a2936 commit 8aa9761

File tree

3 files changed

+14
-12
lines changed

3 files changed

+14
-12
lines changed

drivers/edac/edac_device.c

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -394,17 +394,16 @@ static void edac_device_workq_teardown(struct edac_device_ctl_info *edac_dev)
394394
* Then restart the workq on the new delay
395395
*/
396396
void edac_device_reset_delay_period(struct edac_device_ctl_info *edac_dev,
397-
unsigned long value)
397+
unsigned long msec)
398398
{
399-
unsigned long jiffs = msecs_to_jiffies(value);
400-
401-
if (value == 1000)
402-
jiffs = round_jiffies_relative(value);
403-
404-
edac_dev->poll_msec = value;
405-
edac_dev->delay = jiffs;
399+
edac_dev->poll_msec = msec;
400+
edac_dev->delay = msecs_to_jiffies(msec);
406401

407-
edac_mod_work(&edac_dev->work, jiffs);
402+
/* See comment in edac_device_workq_setup() above */
403+
if (edac_dev->poll_msec == 1000)
404+
edac_mod_work(&edac_dev->work, round_jiffies_relative(edac_dev->delay));
405+
else
406+
edac_mod_work(&edac_dev->work, edac_dev->delay);
408407
}
409408

410409
int edac_device_alloc_index(void)

drivers/edac/edac_module.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ bool edac_stop_work(struct delayed_work *work);
5353
bool edac_mod_work(struct delayed_work *work, unsigned long delay);
5454

5555
extern void edac_device_reset_delay_period(struct edac_device_ctl_info
56-
*edac_dev, unsigned long value);
56+
*edac_dev, unsigned long msec);
5757
extern void edac_mc_reset_delay_period(unsigned long value);
5858

5959
/*

drivers/edac/highbank_mc_edac.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,10 @@ static int highbank_mc_probe(struct platform_device *pdev)
174174
drvdata = mci->pvt_info;
175175
platform_set_drvdata(pdev, mci);
176176

177-
if (!devres_open_group(&pdev->dev, NULL, GFP_KERNEL))
178-
return -ENOMEM;
177+
if (!devres_open_group(&pdev->dev, NULL, GFP_KERNEL)) {
178+
res = -ENOMEM;
179+
goto free;
180+
}
179181

180182
r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
181183
if (!r) {
@@ -243,6 +245,7 @@ static int highbank_mc_probe(struct platform_device *pdev)
243245
edac_mc_del_mc(&pdev->dev);
244246
err:
245247
devres_release_group(&pdev->dev, NULL);
248+
free:
246249
edac_mc_free(mci);
247250
return res;
248251
}

0 commit comments

Comments
 (0)