linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* re: Staging: media: replace pr_* with dev_*
@ 2015-03-19 22:38 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2015-03-19 22:38 UTC (permalink / raw)
  To: hamohammed.sa; +Cc: linux-media

Hello Haneen Mohammed,

The patch 2c9356d115c9: "Staging: media: replace pr_* with dev_*"
from Mar 18, 2015, leads to the following static checker warning:

	drivers/staging/media/lirc/lirc_sasem.c:176 delete_context()
	error: dereferencing freed memory 'context'

drivers/staging/media/lirc/lirc_sasem.c
   166  static void delete_context(struct sasem_context *context)
   167  {
   168          usb_free_urb(context->tx_urb);  /* VFD */
   169          usb_free_urb(context->rx_urb);  /* IR */
   170          lirc_buffer_free(context->driver->rbuf);
   171          kfree(context->driver->rbuf);
   172          kfree(context->driver);
   173          kfree(context);
                      ^^^^^^^
Free.

   174  
   175          if (debug)
   176                  dev_info(&context->dev->dev, "%s: context deleted\n",
                                  ^^^^^^^^^^^^^^^^^
Use after free.  We could go back to pr_info(), or move this in front of
the free or probably the best option is just to delete the printk.  It
doesn't look very useful.

   177                           __func__);
   178  }

regards,
dan carpenter

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

only message in thread, other threads:[~2015-03-19 22:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-19 22:38 Staging: media: replace pr_* with dev_* Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).