Re: [PATCH] staging: unisys: virtpci: virtpci: Fix for possible null pointer dereference

2015-01-30 Thread Rickard Strandqvist
2015-01-30 13:59 GMT+01:00 Peter Hurley pe...@hurleysoftware.com: On 01/30/2015 07:39 AM, Dan Carpenter wrote: Btw, if you have the smatch cross function database set up then you can figure out this sort of thing by using: $ smdb.py virtpci_driver_attr_store It says that:

Re: [PATCH] staging: unisys: virtpci: virtpci: Fix for possible null pointer dereference

2015-01-30 Thread Dan Carpenter
Run your patches through checkpatch.pl. On Thu, Jan 29, 2015 at 07:50:26PM +0100, Rickard Strandqvist wrote: - if (dprivate != NULL) + if (dprivate != NULL) { This is a double negative. Just say if (dprivate) {. Actually just reverse the test and remove the bogus printk. Say:

Re: [PATCH] staging: unisys: virtpci: virtpci: Fix for possible null pointer dereference

2015-01-30 Thread Peter Hurley
On 01/30/2015 07:39 AM, Dan Carpenter wrote: Btw, if you have the smatch cross function database set up then you can figure out this sort of thing by using: $ smdb.py virtpci_driver_attr_store It says that: fs/sysfs/file.c | sysfs_kf_write | (struct sysfs_ops)-store |

[PATCH] staging: unisys: virtpci: virtpci: Fix for possible null pointer dereference

2015-01-29 Thread Rickard Strandqvist
Fix a possible null pointer dereference, there is otherwise a risk of a possible null pointer dereference. This was found using a static code analysis program called cppcheck Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se --- drivers/staging/unisys/virtpci/virtpci.c |