From: "Gustavo A. R. Silva" <garsilva@embeddedor.com>
To: Felipe Balbi <balbi@kernel.org>
Cc: Michal Nazarewicz <mina86@mina86.com>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
gregkh@linuxfoundation.org, heikki.krogerus@linux.intel.com,
mail@iagoabal.eu, linux-usb@vger.kernel.org,
linux-kernel@vger.kernel.org,
Peter Senna Tschudin <peter.senna@gmail.com>,
"Gustavo A. R. Silva" <garsilva@embeddedor.com>
Subject: [PATCH v4] usb: gadget: udc: remove pointer dereference after free
Date: Fri, 10 Mar 2017 15:39:32 -0600 [thread overview]
Message-ID: <20170310213932.GA5340@embeddedgus> (raw)
In-Reply-To: <20170310152037.Horde.49bdIvAhaWSa41VTBWvs3xO@gator4166.hostgator.com>
Remove pointer dereference after free.
Addresses-Coverity-ID: 1091173
Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
---
Changes in v2:
Move pointer dereference before pci_pool_free()
Set pointer to NULL after free
Changes in v3:
Remove 'td->next = 0x00' inside for loop.
Remove unnecessary pointer nullification after free.
Changes in v4:
Fix line-wrapping in previous patch.
drivers/usb/gadget/udc/pch_udc.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/usb/gadget/udc/pch_udc.c b/drivers/usb/gadget/udc/pch_udc.c
index a97da64..8a365aa 100644
--- a/drivers/usb/gadget/udc/pch_udc.c
+++ b/drivers/usb/gadget/udc/pch_udc.c
@@ -1523,7 +1523,6 @@ static void pch_udc_free_dma_chain(struct pch_udc_dev *dev,
td = phys_to_virt(addr);
addr2 = (dma_addr_t)td->next;
pci_pool_free(dev->data_requests, td, addr);
- td->next = 0x00;
addr = addr2;
}
req->chain_len = 1;
--
2.5.0
prev parent reply other threads:[~2017-03-10 21:39 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-08 19:15 [PATCH] drivers: usb: gadget: udc: remove pointer dereference after free Gustavo A. R. Silva
2017-02-08 19:37 ` Andy Shevchenko
2017-02-08 21:33 ` Gustavo A. R. Silva
2017-02-11 17:07 ` [PATCH v2] " Gustavo A. R. Silva
2017-02-13 16:02 ` Michal Nazarewicz
2017-02-14 4:50 ` Gustavo A. R. Silva
2017-02-14 4:53 ` [PATCH v3] " Gustavo A. R. Silva
2017-03-10 11:35 ` Felipe Balbi
2017-03-10 21:20 ` Gustavo A. R. Silva
2017-03-10 21:39 ` Gustavo A. R. Silva [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170310213932.GA5340@embeddedgus \
--to=garsilva@embeddedor.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=balbi@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=heikki.krogerus@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mail@iagoabal.eu \
--cc=mina86@mina86.com \
--cc=peter.senna@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.