Skip to content

Commit

Permalink
Merge tag 'staging-6.12-rc7' of git://git.kernel.org/pub/scm/linux/ke…
Browse files Browse the repository at this point in the history
…rnel/git/gregkh/staging

Pull staging driver fixes from Greg KH:
 "Here are two small memory leak fixes for the vchiq_arm staging driver
  that have been sitting in my tree for weeks and should get merged for
  6.12-rc7 so that people don't keep tripping over them.

  They both have been in linux-next for a while with no reported
  problems"

* tag 'staging-6.12-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
  staging: vchiq_arm: Use devm_kzalloc() for drv_mgmt allocation
  staging: vchiq_arm: Use devm_kzalloc() for vchiq_arm_state allocation
  • Loading branch information
Linus Torvalds committed Nov 10, 2024
2 parents de2f378 + 807babf commit 023d4fc
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ vchiq_platform_init_state(struct vchiq_state *state)
{
struct vchiq_arm_state *platform_state;

platform_state = kzalloc(sizeof(*platform_state), GFP_KERNEL);
platform_state = devm_kzalloc(state->dev, sizeof(*platform_state), GFP_KERNEL);
if (!platform_state)
return -ENOMEM;

Expand Down Expand Up @@ -1731,7 +1731,7 @@ static int vchiq_probe(struct platform_device *pdev)
return -ENOENT;
}

mgmt = kzalloc(sizeof(*mgmt), GFP_KERNEL);
mgmt = devm_kzalloc(&pdev->dev, sizeof(*mgmt), GFP_KERNEL);
if (!mgmt)
return -ENOMEM;

Expand Down Expand Up @@ -1789,8 +1789,6 @@ static void vchiq_remove(struct platform_device *pdev)

arm_state = vchiq_platform_get_arm_state(&mgmt->state);
kthread_stop(arm_state->ka_thread);

kfree(mgmt);
}

static struct platform_driver vchiq_driver = {
Expand Down

0 comments on commit 023d4fc

Please sign in to comment.