Skip to content

Commit 94d4154

Browse files
richard-bootlinalexandrebelloni
authored andcommitted
rtc: tps6594: Fix memleak in probe
struct rtc_device is allocated twice in probe(), once with devm_kzalloc(), and then with devm_rtc_allocate_device(). The allocation with devm_kzalloc() is lost and superfluous. Fixes: 9f67c1e ("rtc: tps6594: Add driver for TPS6594 RTC") Signed-off-by: Richard Genoud <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
1 parent 1613e60 commit 94d4154

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

drivers/rtc/rtc-tps6594.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -360,10 +360,6 @@ static int tps6594_rtc_probe(struct platform_device *pdev)
360360
int irq;
361361
int ret;
362362

363-
rtc = devm_kzalloc(dev, sizeof(*rtc), GFP_KERNEL);
364-
if (!rtc)
365-
return -ENOMEM;
366-
367363
rtc = devm_rtc_allocate_device(dev);
368364
if (IS_ERR(rtc))
369365
return PTR_ERR(rtc);

0 commit comments

Comments
 (0)