All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] Staging: emxx_udc: Make a read-only structure
@ 2016-10-18 20:42 Mihaela Muraru
  2016-10-18 20:48 ` [Outreachy kernel] " Julia Lawall
  0 siblings, 1 reply; 7+ messages in thread
From: Mihaela Muraru @ 2016-10-18 20:42 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: outreachy-kernel

This patch add const qualifier at the declaration of the structure,
because it contains information about usb hardware device and those
values shoud not be overwritten.

The structure become a read-only data, this increase the security and
the integrity of the program.

Found with Coccinelle:
@r disable optional_qualifier@
identifier s,i;
@@
* static struct s i ={...};

Signed-off-by: Mihaela Muraru <mihaela.muraru21@gmail.com>
---
 drivers/staging/emxx_udc/emxx_udc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/emxx_udc/emxx_udc.c b/drivers/staging/emxx_udc/emxx_udc.c
index c3e2988..8b406f3 100644
--- a/drivers/staging/emxx_udc/emxx_udc.c
+++ b/drivers/staging/emxx_udc/emxx_udc.c
@@ -1386,7 +1386,7 @@ static void _nbu2ss_set_endpoint_stall(
 
 /*-------------------------------------------------------------------------*/
 /* Device Descriptor */
-static struct usb_device_descriptor device_desc = {
+static const struct usb_device_descriptor device_desc = {
 	.bLength              = sizeof(device_desc),
 	.bDescriptorType      = USB_DT_DEVICE,
 	.bcdUSB               = cpu_to_le16(0x0200),
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-10-19 15:20 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-18 20:42 [PATCH v2] Staging: emxx_udc: Make a read-only structure Mihaela Muraru
2016-10-18 20:48 ` [Outreachy kernel] " Julia Lawall
2016-10-18 21:39   ` Muraru Mihaela
2016-10-19  6:01     ` Julia Lawall
2016-10-19  6:18       ` Muraru Mihaela
2016-10-19  7:35         ` Greg Kroah-Hartman
2016-10-19 15:20           ` Muraru Mihaela

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.