Linux Media Controller development
 help / color / mirror / Atom feed
* [bug report] media: ti-vpe: Fix a missing check and reference count leak
@ 2020-09-29 10:19 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2020-09-29 10:19 UTC (permalink / raw)
  To: wu000273; +Cc: linux-media

Hello Qiushi Wu,

The patch 7dae2aaaf432: "media: ti-vpe: Fix a missing check and
reference count leak" from Jun 14, 2020, leads to the following
static checker warning:

	drivers/media/platform/ti-vpe/vpe.c:2478 vpe_runtime_get()
	warn: pm_runtime_get_sync() also returns 1 on success

drivers/media/platform/ti-vpe/vpe.c
  2470  static int vpe_runtime_get(struct platform_device *pdev)
  2471  {
  2472          int r;
  2473  
  2474          dev_dbg(&pdev->dev, "vpe_runtime_get\n");
  2475  
  2476          r = pm_runtime_get_sync(&pdev->dev);
  2477          WARN_ON(r < 0);
  2478          if (r)
  2479                  pm_runtime_put_noidle(&pdev->dev);

The pm_runtime_get_sync() function is tricky because it can return
either zero or one on the success path.  (So this patch can break the
success path.)

  2480          return r < 0 ? r : 0;
  2481  }

regards,
dan carpenter

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-09-29 10:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-29 10:19 [bug report] media: ti-vpe: Fix a missing check and reference count leak Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox