[PATCH 0/2] add missing calls to kfree

2016-08-12 Thread Quentin Lambert
The first patch is a style fix, the second add calls to kfree.
The reason for me thinking that they are necessary is that every other branches
leading to an error return are jumping to the same destination.

---
 drivers/staging/rts5208/ms.c |   18 ++
 1 file changed, 10 insertions(+), 8 deletions(-)
---
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 2/2] staging: rts5208/ms.c: add missing releases in mg_get_local_EKB and mg_get_ICV

2016-08-12 Thread Quentin Lambert
mg_get_local_EKB and mg_get_ICV used to return with an error code before
releasing all resources. This patch add a jump to the appropriate label
ensuring that the resources are properly released before returning.

This issue was found with Hector.

Signed-off-by: Quentin Lambert 
---
 drivers/staging/rts5208/ms.c |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

--- a/drivers/staging/rts5208/ms.c
+++ b/drivers/staging/rts5208/ms.c
@@ -4328,7 +4328,8 @@ int mg_get_local_EKB(struct scsi_cmnd *s
set_sense_type(chip, lun, SENSE_TYPE_MG_KEY_FAIL_NOT_AUTHEN);
rtsx_clear_ms_error(chip);
rtsx_trace(chip);
-   return STATUS_FAIL;
+   retval = STATUS_FAIL;
+   goto free_buffer;
}
 
bufflen = min_t(int, 1052, scsi_bufflen(srb));
@@ -4581,7 +4582,8 @@ int mg_get_ICV(struct scsi_cmnd *srb, st
set_sense_type(chip, lun, SENSE_TYPE_MEDIA_UNRECOVER_READ_ERR);
rtsx_clear_ms_error(chip);
rtsx_trace(chip);
-   return STATUS_FAIL;
+   retval = STATUS_FAIL;
+   goto free_buffer;
}
 
bufflen = min_t(int, 1028, scsi_bufflen(srb));
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/2] staging: rts5208/ms.c: change the label name to respect the coding style

2016-08-12 Thread Quentin Lambert
Signed-off-by: Quentin Lambert 
---
 drivers/staging/rts5208/ms.c |   12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

--- a/drivers/staging/rts5208/ms.c
+++ b/drivers/staging/rts5208/ms.c
@@ -4313,7 +4313,7 @@ int mg_get_local_EKB(struct scsi_cmnd *s
if (retval != STATUS_SUCCESS) {
set_sense_type(chip, lun, SENSE_TYPE_MG_KEY_FAIL_NOT_AUTHEN);
rtsx_trace(chip);
-   goto GetEKBFinish;
+   goto free_buffer;
}
 
retval = ms_transfer_data(chip, MS_TM_AUTO_READ, PRO_READ_LONG_DATA,
@@ -4322,7 +4322,7 @@ int mg_get_local_EKB(struct scsi_cmnd *s
set_sense_type(chip, lun, SENSE_TYPE_MG_KEY_FAIL_NOT_AUTHEN);
rtsx_clear_ms_error(chip);
rtsx_trace(chip);
-   goto GetEKBFinish;
+   goto free_buffer;
}
if (check_ms_err(chip)) {
set_sense_type(chip, lun, SENSE_TYPE_MG_KEY_FAIL_NOT_AUTHEN);
@@ -4334,7 +4334,7 @@ int mg_get_local_EKB(struct scsi_cmnd *s
bufflen = min_t(int, 1052, scsi_bufflen(srb));
rtsx_stor_set_xfer_buf(buf, bufflen, srb);
 
-GetEKBFinish:
+free_buffer:
kfree(buf);
return retval;
 }
@@ -4566,7 +4566,7 @@ int mg_get_ICV(struct scsi_cmnd *srb, st
if (retval != STATUS_SUCCESS) {
set_sense_type(chip, lun, SENSE_TYPE_MEDIA_UNRECOVER_READ_ERR);
rtsx_trace(chip);
-   goto GetICVFinish;
+   goto free_buffer;
}
 
retval = ms_transfer_data(chip, MS_TM_AUTO_READ, PRO_READ_LONG_DATA,
@@ -4575,7 +4575,7 @@ int mg_get_ICV(struct scsi_cmnd *srb, st
set_sense_type(chip, lun, SENSE_TYPE_MEDIA_UNRECOVER_READ_ERR);
rtsx_clear_ms_error(chip);
rtsx_trace(chip);
-   goto GetICVFinish;
+   goto free_buffer;
}
if (check_ms_err(chip)) {
set_sense_type(chip, lun, SENSE_TYPE_MEDIA_UNRECOVER_READ_ERR);
@@ -4587,7 +4587,7 @@ int mg_get_ICV(struct scsi_cmnd *srb, st
bufflen = min_t(int, 1028, scsi_bufflen(srb));
rtsx_stor_set_xfer_buf(buf, bufflen, srb);
 
-GetICVFinish:
+free_buffer:
kfree(buf);
return retval;
 }
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: staging: ks7010: Replace three printk() calls by pr_err()

2016-08-12 Thread SF Markus Elfring
>>> Can't we use dev_* on the SDIO device?
>>
>> How should a connection be constructed from the data structure 
>> "sdio_device_id"
>> to the corresponding device information for such an use case?
> 
> What did you try so far?

Nothing what I would find noteworthy for increasing the usage of a function
like "dev_err".

Are you on "a mission" to improve software around logging calls a bit more?

Regards,
Markus
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 1/2] staging: rts5208/ms.c: change the label name to respect the coding style

2016-08-12 Thread Greg Kroah-Hartman
On Fri, Aug 12, 2016 at 02:58:34PM +0200, Quentin Lambert wrote:
> Signed-off-by: Quentin Lambert 
> ---
>  drivers/staging/rts5208/ms.c |   12 ++--
>  1 file changed, 6 insertions(+), 6 deletions(-)

I can't take patches without any changelog comments, sorry.

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


RE: [PATCH 0/2] Drivers: hv: vmbus: make bus ids in sysfs persistent

2016-08-12 Thread KY Srinivasan


> -Original Message-
> From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com]
> Sent: Thursday, August 11, 2016 2:17 AM
> To: KY Srinivasan 
> Cc: de...@linuxdriverproject.org; linux-ker...@vger.kernel.org; Haiyang Zhang
> 
> Subject: Re: [PATCH 0/2] Drivers: hv: vmbus: make bus ids in sysfs persistent
> 
> KY Srinivasan  writes:
> 
> >> -Original Message-
> >> From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com]
> >> Sent: Tuesday, August 9, 2016 1:46 AM
> >> To: de...@linuxdriverproject.org
> >> Cc: linux-ker...@vger.kernel.org; Haiyang Zhang
> >> ; KY Srinivasan 
> >> Subject: [PATCH 0/2] Drivers: hv: vmbus: make bus ids in sysfs
> >> persistent
> >>
> >> Bus ids for VMBus devices in /sys/bus/vmbus/devices/ are not
> >> guaranteed to be persistent across reboot or kernel restart and this
> >> causes problems for some tools. E.g. kexec tools use these ids to identify
> NIC on kdump.
> >> Fix the issue by using relid from channel offer as the unique id
> >> instead of an auto incremented counter.
> >
> > Relids are not persistent. It is only valid between a channel offer
> > message and a relid released message (or an unload or initiate contact
> > message, which invalidates all channels). This is an opaque number
> > that the root generates and uses to track channels. There is no
> > guarantee that the same type of channel (networking, storage, etc)
> > will get the same relid on each reboot.
> >
> 
> Thanks for the info,
> 
> can we use device_id (offermsg.offer.if_instance.b) instead?

I think you could; I am going to verify and get back to you on this.
Sometime back I removed all the non-determinism in the vmbus device
ID generation. Now, the current scheme of generating the device IDs does
result in persistent IDs across boot (as long as the host presents the devices
to the guest in the same order across boots). Do you have this fix?

Regards,

K. Y
> 
> --
>   Vitaly
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 0/2] add missing calls to kfree

2016-08-12 Thread Quentin Lambert
The first patch is a style fix, the second add calls to kfree.
The reason for me thinking that they are necessary is that every other branches
leading to an error return are jumping to the same destination.

v2: add a commit message to the first patch

---
 drivers/staging/rts5208/ms.c |   18 ++
 1 file changed, 10 insertions(+), 8 deletions(-)
---
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 2/2] staging: rts5208/ms.c: add missing releases in mg_get_local_EKB and mg_get_ICV

2016-08-12 Thread Quentin Lambert
mg_get_local_EKB and mg_get_ICV used to return with an error code before
releasing all resources. This patch add a jump to the appropriate label
ensuring that the resources are properly released before returning.

This issue was found with Hector.

Signed-off-by: Quentin Lambert 
---
 drivers/staging/rts5208/ms.c |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

--- a/drivers/staging/rts5208/ms.c
+++ b/drivers/staging/rts5208/ms.c
@@ -4328,7 +4328,8 @@ int mg_get_local_EKB(struct scsi_cmnd *s
set_sense_type(chip, lun, SENSE_TYPE_MG_KEY_FAIL_NOT_AUTHEN);
rtsx_clear_ms_error(chip);
rtsx_trace(chip);
-   return STATUS_FAIL;
+   retval = STATUS_FAIL;
+   goto free_buffer;
}
 
bufflen = min_t(int, 1052, scsi_bufflen(srb));
@@ -4581,7 +4582,8 @@ int mg_get_ICV(struct scsi_cmnd *srb, st
set_sense_type(chip, lun, SENSE_TYPE_MEDIA_UNRECOVER_READ_ERR);
rtsx_clear_ms_error(chip);
rtsx_trace(chip);
-   return STATUS_FAIL;
+   retval = STATUS_FAIL;
+   goto free_buffer;
}
 
bufflen = min_t(int, 1028, scsi_bufflen(srb));
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 1/2] staging: rts5208/ms.c: change the label name to respect the coding style

2016-08-12 Thread Quentin Lambert
This patch changes label names using camel case to snake case as well as giving
a new name representing what will be done after the label.

Signed-off-by: Quentin Lambert 
---
v2: add a commit message

 drivers/staging/rts5208/ms.c |   12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

--- a/drivers/staging/rts5208/ms.c
+++ b/drivers/staging/rts5208/ms.c
@@ -4313,7 +4313,7 @@ int mg_get_local_EKB(struct scsi_cmnd *s
if (retval != STATUS_SUCCESS) {
set_sense_type(chip, lun, SENSE_TYPE_MG_KEY_FAIL_NOT_AUTHEN);
rtsx_trace(chip);
-   goto GetEKBFinish;
+   goto free_buffer;
}
 
retval = ms_transfer_data(chip, MS_TM_AUTO_READ, PRO_READ_LONG_DATA,
@@ -4322,7 +4322,7 @@ int mg_get_local_EKB(struct scsi_cmnd *s
set_sense_type(chip, lun, SENSE_TYPE_MG_KEY_FAIL_NOT_AUTHEN);
rtsx_clear_ms_error(chip);
rtsx_trace(chip);
-   goto GetEKBFinish;
+   goto free_buffer;
}
if (check_ms_err(chip)) {
set_sense_type(chip, lun, SENSE_TYPE_MG_KEY_FAIL_NOT_AUTHEN);
@@ -4334,7 +4334,7 @@ int mg_get_local_EKB(struct scsi_cmnd *s
bufflen = min_t(int, 1052, scsi_bufflen(srb));
rtsx_stor_set_xfer_buf(buf, bufflen, srb);
 
-GetEKBFinish:
+free_buffer:
kfree(buf);
return retval;
 }
@@ -4566,7 +4566,7 @@ int mg_get_ICV(struct scsi_cmnd *srb, st
if (retval != STATUS_SUCCESS) {
set_sense_type(chip, lun, SENSE_TYPE_MEDIA_UNRECOVER_READ_ERR);
rtsx_trace(chip);
-   goto GetICVFinish;
+   goto free_buffer;
}
 
retval = ms_transfer_data(chip, MS_TM_AUTO_READ, PRO_READ_LONG_DATA,
@@ -4575,7 +4575,7 @@ int mg_get_ICV(struct scsi_cmnd *srb, st
set_sense_type(chip, lun, SENSE_TYPE_MEDIA_UNRECOVER_READ_ERR);
rtsx_clear_ms_error(chip);
rtsx_trace(chip);
-   goto GetICVFinish;
+   goto free_buffer;
}
if (check_ms_err(chip)) {
set_sense_type(chip, lun, SENSE_TYPE_MEDIA_UNRECOVER_READ_ERR);
@@ -4587,7 +4587,7 @@ int mg_get_ICV(struct scsi_cmnd *srb, st
bufflen = min_t(int, 1028, scsi_bufflen(srb));
rtsx_stor_set_xfer_buf(buf, bufflen, srb);
 
-GetICVFinish:
+free_buffer:
kfree(buf);
return retval;
 }
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] Staging: rtl8723au: os_intfs: fixed case statement is variable issue

2016-08-12 Thread Jes Sorensen
sunbing  writes:
> On Aug 11, 2016, at 23:25, Jes Sorensen  wrote:
>
>> Bing Sun  writes:
>>> Fixed sparse parse error:
>>> Expected constant expression in case statement.
>>> 
>>> Signed-off-by: Bing Sun 
>>> ---
>>> drivers/staging/rtl8723au/os_dep/os_intfs.c | 11 +--
>>> 1 file changed, 5 insertions(+), 6 deletions(-)
>>> 
>>> diff --git a/drivers/staging/rtl8723au/os_dep/os_intfs.c 
>>> b/drivers/staging/rtl8723au/os_dep/os_intfs.c
>>> index b8848c2..f30d5d2 100644
>>> --- a/drivers/staging/rtl8723au/os_dep/os_intfs.c
>>> +++ b/drivers/staging/rtl8723au/os_dep/os_intfs.c
>>> @@ -283,14 +283,13 @@ static u32 rtw_classify8021d(struct sk_buff *skb)
>>>  */
>>> if (skb->priority >= 256 && skb->priority <= 263)
>>> return skb->priority - 256;
>>> -   switch (skb->protocol) {
>>> -   case htons(ETH_P_IP):
>>> +
>>> +   if (skb->protocol == htons(ETH_P_IP)) {
>>> dscp = ip_hdr(skb)->tos & 0xfc;
>>> -   break;
>>> -   default:
>>> -   return 0;
>>> +   return dscp >> 5;
>>> }
>>> -   return dscp >> 5;
>>> +
>>> +   return 0;
>>> }
>> 
>> Pardon me here, but I find it really hard to see how this change is an
>> improvement over the old code in any shape or form.
>> 
>> Jes
>
> There is no functional improvement. 
> But before this patch, when we do: make C=1 M=drivers/staging/rtl8723au/
> An error output: 
> drivers/staging/rtl8723au//os_dep/os_intfs.c:287:14: error: Expected
> constant expression in case statement
> To avoid sparse parse error, a case statement converts to an if statement.
> So we got this patch.

Hello

I understand this part, but it seems to me we are changing the code due
to a broken test case in sparse. Does the warning go away if you use
__constant_htons() instead of htons()?

Jes
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH net 2/4] hv_netvsc: reset vf_inject on VF removal

2016-08-12 Thread Stephen Hemminger
On Thu, 11 Aug 2016 14:09:53 +0200
Vitaly Kuznetsov  wrote:

> Yuval Mintz  writes:
> 
> >> +static void netvsc_inject_enable(struct net_device_context
> >> +*net_device_ctx) {
> >> +  net_device_ctx->vf_inject = true;
> >> +}
> >> +
> >> +static void netvsc_inject_disable(struct net_device_context
> >> +*net_device_ctx) {
> >> +  net_device_ctx->vf_inject = false;
> >> +
> >> +  /* Wait for currently active users to drain out. */
> >> +  while (atomic_read(&net_device_ctx->vf_use_cnt) != 0)
> >> +  udelay(50);
> >> +}  
> >
> > That was already the behavior before, but are you certain you
> > want to unconditionally block without any possible timeout?  
> 
> Yes, this is OK. After PATCH4 of this series there is only one place
> which takes the vf_use_cnt (netvsc_recv_callback()) and it is an
> interrupt handler, there are no sleepable operations there.
> 

Since network devices are protected by RCU, it looks like the refcount
is not necessary.  I think vf_inject flag and vf_use_cnt could just be replaced
by doing RCU on vf_netdev.

The callback is invoked from tasklet (softirq) context.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: staging: ks7010: Replace three printk() calls by pr_err()

2016-08-12 Thread Wolfram Sang

> Nothing what I would find noteworthy for increasing the usage of a function
> like "dev_err".
> 
> Are you on "a mission" to improve software around logging calls a bit more?

I have two of those cards and I would like to know which one caused an
error. dev_err helps with exactly that.



signature.asc
Description: PGP signature
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Business and Project FINANCING!

2016-08-12 Thread PROJECT & BUSINESS FUNDING LIAISON
ARE YOU LOOKING TO START A NEW BUSINESS?
ARE YOU LOOKING TO DEVELOP AN EXISTING BUSINESS?
ARE YOU LOOKING FOR FINANCE FOR A PROJECT OR BUSINESS?
ARE YOU LOOKING SEEKING FINANCE FOR A REAL-ESTATE DEVELOPMENT?
ARE YOU SEEKING FINANCE TO PURCHASE OR INVEST IN PROPERTIES?
OR YOU SEEK A 100% BUSINESS/PROJECT PARTNERSHIP INVESTOR?

We’re a marketplace that connects established businesses looking to borrow, 
with people and other investors who want to lend. By cutting out the costs and 
complexity of dealing with banks, you can get an affordable loan for your 
business in just one week. As active Investors and Financiers in sectors and 
geographies that hold potential and tangible returns, we work in partnership 
with a number of world-class organizations with a combined International pool 
of nearly Half a Trillion in available Liquidity.

We have a confirmed Cash Backed Financial Facility ready to be invested only in 
your country. The Board of Directors of the Investment Institution today 
approved EUR 9.4 billion of new financing for 56 projects across Europe and 
around the world. This include more than EUR 2.8 billion for new loans for 
projects backed by guarantee for Strategic Investments.

If you have a viable project or business requiring financing, do contact me 
with SERIOUS ENQUIRIES ONLY on email business-...@europe.com providing us with 
your full names and contact telephone number for an assessment.

The Senior Consultant
BUSINESS RBS
125 Old Broad Street
EC2N 1AR London
business-...@europe.com 


___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v2 08/10] staging: ks7010: Replace three printk() calls by pr_err()

2016-08-12 Thread Joe Perches
On Thu, 2016-08-11 at 07:48 +0200, SF Markus Elfring wrote:
> Prefer usage of the macro "pr_err" over the interface "printk".
Not correct

> diff --git a/drivers/staging/ks7010/ks7010_sdio.c 
> b/drivers/staging/ks7010/ks7010_sdio.c
[]
> @@ -998,11 +998,11 @@ static int ks7010_sdio_probe(struct sdio_func *func,
>   /* private memory allocate */
>   netdev = alloc_etherdev(sizeof(*priv));
>   if (netdev == NULL) {
> - printk(KERN_ERR "ks7010 : Unable to alloc new net device\n");
> + pr_err(pr_fmt("Unable to alloc new net device\n"));

All of these pr_fmt uses are redundant as pr_err already does pr_fmt
alloc_etherdev already does a dump_stack so the OOM isn't useful.

>   goto release_irq;
>   }
>   if (dev_alloc_name(netdev, "wlan%d") < 0) {
> - printk(KERN_ERR "ks7010 :  Couldn't get name!\n");
> + pr_err(pr_fmt("Couldn't get name!\n"));
>   goto free_dev;
>   }
>  
> @@ -1042,8 +1042,7 @@ static int ks7010_sdio_probe(struct sdio_func *func,
>   /* Upload firmware */
>   ret = ks7010_upload_firmware(priv, card);   /* firmware load */
>   if (ret) {
> - printk(KERN_ERR
> -    "ks7010: firmware load failed !! retern code = %d\n",
> + pr_err(pr_fmt("firmware load failed! return code = %d\n"),
>      ret);
>   goto free_buf;
>   }
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] hv: mark hv_driver read only after init

2016-08-12 Thread Stephen Hemminger

For hardening, the driver structure containing function pointers can
be marked read only after initial registration is done.

Signed-off-by: Stephen Hemminger 

---
 drivers/hid/hid-hyperv.c  |2 +-
 drivers/input/serio/hyperv-keyboard.c |2 +-
 drivers/net/hyperv/netvsc_drv.c   |2 +-
 drivers/pci/host/pci-hyperv.c |2 +-
 drivers/scsi/storvsc_drv.c|2 +-
 drivers/video/fbdev/hyperv_fb.c   |2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

--- a/drivers/net/hyperv/netvsc_drv.c   2016-08-12 16:23:42.077030799 -0700
+++ b/drivers/net/hyperv/netvsc_drv.c   2016-08-12 16:23:42.073030781 -0700
@@ -1488,7 +1488,7 @@ static const struct hv_vmbus_device_id i
 MODULE_DEVICE_TABLE(vmbus, id_table);
 
 /* The one and only one */
-static struct  hv_driver netvsc_drv = {
+static struct hv_driver netvsc_drv __ro_after_init = {
.name = KBUILD_MODNAME,
.id_table = id_table,
.probe = netvsc_probe,
--- a/drivers/hid/hid-hyperv.c  2016-08-12 16:23:42.077030799 -0700
+++ b/drivers/hid/hid-hyperv.c  2016-08-12 16:23:42.077030799 -0700
@@ -593,7 +593,7 @@ static const struct hv_vmbus_device_id i
 
 MODULE_DEVICE_TABLE(vmbus, id_table);
 
-static struct  hv_driver mousevsc_drv = {
+static struct hv_driver mousevsc_drv __ro_after_init = {
.name = KBUILD_MODNAME,
.id_table = id_table,
.probe = mousevsc_probe,
--- a/drivers/input/serio/hyperv-keyboard.c 2016-08-12 16:23:42.077030799 
-0700
+++ b/drivers/input/serio/hyperv-keyboard.c 2016-08-12 16:23:42.077030799 
-0700
@@ -420,7 +420,7 @@ static const struct hv_vmbus_device_id i
 
 MODULE_DEVICE_TABLE(vmbus, id_table);
 
-static struct  hv_driver hv_kbd_drv = {
+static struct hv_driver hv_kbd_drv __ro_after_init = {
.name = KBUILD_MODNAME,
.id_table = id_table,
.probe = hv_kbd_probe,
@@ -434,6 +434,7 @@ static int __init hv_kbd_init(void)
 
 static void __exit hv_kbd_exit(void)
 {
+
vmbus_driver_unregister(&hv_kbd_drv);
 }
 
--- a/drivers/pci/host/pci-hyperv.c 2016-08-12 16:23:42.077030799 -0700
+++ b/drivers/pci/host/pci-hyperv.c 2016-08-12 16:23:42.077030799 -0700
@@ -2340,7 +2340,7 @@ static const struct hv_vmbus_device_id h
 
 MODULE_DEVICE_TABLE(vmbus, hv_pci_id_table);
 
-static struct hv_driver hv_pci_drv = {
+static struct hv_driver hv_pci_drv __ro_after_init = {
.name   = "hv_pci",
.id_table   = hv_pci_id_table,
.probe  = hv_pci_probe,
--- a/drivers/scsi/storvsc_drv.c2016-08-12 16:23:42.077030799 -0700
+++ b/drivers/scsi/storvsc_drv.c2016-08-12 16:23:42.077030799 -0700
@@ -1739,7 +1739,7 @@ static int storvsc_remove(struct hv_devi
return 0;
 }
 
-static struct hv_driver storvsc_drv = {
+static struct hv_driver storvsc_drv __ro_after_init = {
.name = KBUILD_MODNAME,
.id_table = id_table,
.probe = storvsc_probe,
--- a/drivers/video/fbdev/hyperv_fb.c   2016-08-12 16:23:42.077030799 -0700
+++ b/drivers/video/fbdev/hyperv_fb.c   2016-08-12 16:23:42.077030799 -0700
@@ -907,7 +907,7 @@ static const struct hv_vmbus_device_id i
 MODULE_DEVICE_TABLE(pci, pci_stub_id_table);
 MODULE_DEVICE_TABLE(vmbus, id_table);
 
-static struct hv_driver hvfb_drv = {
+static struct hv_driver hvfb_drv __ro_after_init = {
.name = KBUILD_MODNAME,
.id_table = id_table,
.probe = hvfb_probe,
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


KЛИЕHTCKИЕ БАЗЫ МАЙЛ:bawupecoda-3...@mega.zik.dj CKАЙП: prodawez389 Для быcmpой мАccовой npодАжu ВАшuх mовАpов u уcлуг! Подpобноcmu узнАйme ceйчАc!

2016-08-12 Thread de...@driverdev.osuosl.org
Сo6ерем gля Bас nо uнmeрнem 6азу qaнных nоmенцuальныx kлиентов gля Вaшero 
Бuзнесa! B бaзe 6yqут вce контакmные qанные неoбxoдимые gля мacсoвoй nрogажu 
Baшиx товapoв и уcлуr. Пo Вашeмy зaпрoсy пpишлeм npuмep и noqpo6ную инфopмaцию. 
Еcли интеpecно зanpоcите nogpо6носmи cейчас МАЙЛ: bawupecoda-3...@mega.zik.dj 
CKАЙП: prodawez389 Блаrоqaрим зa быcтpый oтвeт

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] hv: mark hv_driver read only after init

2016-08-12 Thread Kees Cook
On Fri, Aug 12, 2016 at 4:35 PM, Stephen Hemminger
 wrote:
>
> For hardening, the driver structure containing function pointers can
> be marked read only after initial registration is done.

Yay more __ro_after_init! (Minor nit below...)

Also, I wonder if there's a way to do build-time section checking,
e.g. adding "is this hv_driver marked __ro_after_init?" in
__vmbus_driver_register...

> Signed-off-by: Stephen Hemminger 
>
> ---
>  drivers/hid/hid-hyperv.c  |2 +-
>  drivers/input/serio/hyperv-keyboard.c |2 +-
>  drivers/net/hyperv/netvsc_drv.c   |2 +-
>  drivers/pci/host/pci-hyperv.c |2 +-
>  drivers/scsi/storvsc_drv.c|2 +-
>  drivers/video/fbdev/hyperv_fb.c   |2 +-
>  6 files changed, 6 insertions(+), 6 deletions(-)
>
> --- a/drivers/net/hyperv/netvsc_drv.c   2016-08-12 16:23:42.077030799 -0700
> +++ b/drivers/net/hyperv/netvsc_drv.c   2016-08-12 16:23:42.073030781 -0700
> @@ -1488,7 +1488,7 @@ static const struct hv_vmbus_device_id i
>  MODULE_DEVICE_TABLE(vmbus, id_table);
>
>  /* The one and only one */
> -static struct  hv_driver netvsc_drv = {
> +static struct hv_driver netvsc_drv __ro_after_init = {
> .name = KBUILD_MODNAME,
> .id_table = id_table,
> .probe = netvsc_probe,
> --- a/drivers/hid/hid-hyperv.c  2016-08-12 16:23:42.077030799 -0700
> +++ b/drivers/hid/hid-hyperv.c  2016-08-12 16:23:42.077030799 -0700
> @@ -593,7 +593,7 @@ static const struct hv_vmbus_device_id i
>
>  MODULE_DEVICE_TABLE(vmbus, id_table);
>
> -static struct  hv_driver mousevsc_drv = {
> +static struct hv_driver mousevsc_drv __ro_after_init = {
> .name = KBUILD_MODNAME,
> .id_table = id_table,
> .probe = mousevsc_probe,
> --- a/drivers/input/serio/hyperv-keyboard.c 2016-08-12 16:23:42.077030799 
> -0700
> +++ b/drivers/input/serio/hyperv-keyboard.c 2016-08-12 16:23:42.077030799 
> -0700
> @@ -420,7 +420,7 @@ static const struct hv_vmbus_device_id i
>
>  MODULE_DEVICE_TABLE(vmbus, id_table);
>
> -static struct  hv_driver hv_kbd_drv = {
> +static struct hv_driver hv_kbd_drv __ro_after_init = {
> .name = KBUILD_MODNAME,
> .id_table = id_table,
> .probe = hv_kbd_probe,
> @@ -434,6 +434,7 @@ static int __init hv_kbd_init(void)
>
>  static void __exit hv_kbd_exit(void)
>  {
> +

Accidental whitespace addition?

> vmbus_driver_unregister(&hv_kbd_drv);
>  }
>
> --- a/drivers/pci/host/pci-hyperv.c 2016-08-12 16:23:42.077030799 -0700
> +++ b/drivers/pci/host/pci-hyperv.c 2016-08-12 16:23:42.077030799 -0700
> @@ -2340,7 +2340,7 @@ static const struct hv_vmbus_device_id h
>
>  MODULE_DEVICE_TABLE(vmbus, hv_pci_id_table);
>
> -static struct hv_driver hv_pci_drv = {
> +static struct hv_driver hv_pci_drv __ro_after_init = {
> .name   = "hv_pci",
> .id_table   = hv_pci_id_table,
> .probe  = hv_pci_probe,
> --- a/drivers/scsi/storvsc_drv.c2016-08-12 16:23:42.077030799 -0700
> +++ b/drivers/scsi/storvsc_drv.c2016-08-12 16:23:42.077030799 -0700
> @@ -1739,7 +1739,7 @@ static int storvsc_remove(struct hv_devi
> return 0;
>  }
>
> -static struct hv_driver storvsc_drv = {
> +static struct hv_driver storvsc_drv __ro_after_init = {
> .name = KBUILD_MODNAME,
> .id_table = id_table,
> .probe = storvsc_probe,
> --- a/drivers/video/fbdev/hyperv_fb.c   2016-08-12 16:23:42.077030799 -0700
> +++ b/drivers/video/fbdev/hyperv_fb.c   2016-08-12 16:23:42.077030799 -0700
> @@ -907,7 +907,7 @@ static const struct hv_vmbus_device_id i
>  MODULE_DEVICE_TABLE(pci, pci_stub_id_table);
>  MODULE_DEVICE_TABLE(vmbus, id_table);
>
> -static struct hv_driver hvfb_drv = {
> +static struct hv_driver hvfb_drv __ro_after_init = {
> .name = KBUILD_MODNAME,
> .id_table = id_table,
> .probe = hvfb_probe,

Reviewed-by: Kees Cook 

-Kees

-- 
Kees Cook
Nexus Security
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH net 2/4] hv_netvsc: reset vf_inject on VF removal

2016-08-12 Thread David Miller
From: Vitaly Kuznetsov 
Date: Thu, 11 Aug 2016 12:58:55 +0200

> We reset vf_inject on VF going down (netvsc_vf_down()) but we don't on
> VF removal (netvsc_unregister_vf()) so vf_inject stays 'true' while
> vf_netdev is already NULL and we're trying to inject packets into NULL
> net device in netvsc_recv_callback() causing kernel to crash.
> 
> Signed-off-by: Vitaly Kuznetsov 

You can't create a blocking operation problem knowingly in this
patch just because you fix it in patch #4.

You must order your patches such that the driver does not regress
at any intermediate stage of your patch series.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Warning: could not send message for past 4 hours

2016-08-12 Thread Mail Delivery Subsystem
**
**  THIS IS A WARNING MESSAGE ONLY  **
**  YOU DO NOT NEED TO RESEND YOUR MESSAGE  **
**

The original message was received at Wed, 10 Aug 2016 08:10:26 +1000
from TPSAUS-FRSRKEN-COMB1 [127.0.0.1]

   - Transcript of session follows -
... while talking to smtp4.osuosl.org.:
>>> DATA
<<< 451 4.7.1 : Recipient address rejected: 
Greylisted for 5 minutes
... Deferred: 451 4.7.1 
: Recipient address rejected: Greylisted for 5 
minutes
<<< 554 5.5.1 Error: no valid recipients
... while talking to smtp3.osuosl.org.:
>>> DATA
<<< 451 4.7.1 : Recipient address rejected: 
Greylisted for 5 minutes
... Deferred: 451 4.7.1 
: Recipient address rejected: Greylisted for 5 
minutes
<<< 554 5.5.1 Error: no valid recipients
... while talking to smtp1.osuosl.org.:
>>> DATA
<<< 451 4.7.1 : Recipient address rejected: 
Greylisted for 5 minutes
... Deferred: 451 4.7.1 
: Recipient address rejected: Greylisted for 5 
minutes
<<< 554 5.5.1 Error: no valid recipients
... while talking to smtp2.osuosl.org.:
>>> DATA
<<< 451 4.7.1 : Recipient address rejected: 
Greylisted for 5 minutes
... Deferred: 451 4.7.1 
: Recipient address rejected: Greylisted for 5 
minutes
<<< 554 5.5.1 Error: no valid recipients
Warning: message still undelivered after 4 hours
Will keep trying until message is 5 days old
Reporting-MTA: dns; localhost.localdomain
Arrival-Date: Wed, 10 Aug 2016 08:10:26 +1000

Final-Recipient: RFC822; devel@driverdev.osuosl.org
Action: delayed
Status: 4.7.1
Remote-MTA: DNS; smtp2.osuosl.org
Diagnostic-Code: SMTP; 451 4.7.1 : Recipient address rejected: Greylisted for 5 minutes
Last-Attempt-Date: Sat, 13 Aug 2016 11:45:58 +1000
--- Begin Message ---
Сo6ерем gля Bас nо uнmeрнem 6азу qaнных nоmенцuальныx kлиентов gля Вaшero 
Бuзнесa! B бaзe 6yqут вce контакmные qанные неoбxoдимые gля мacсoвoй nрogажu 
Baшиx товapoв и уcлуr. Пo Вашeмy зaпрoсy пpишлeм npuмep и noqpo6ную инфopмaцию. 
Еcли интеpecно зanpоcите nogpо6носmи cейчас МАЙЛ: bawupecoda-3...@mega.zik.dj 
CKАЙП: prodawez389 Блаrоqaрим зa быcтpый oтвeт

--- End Message ---
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel