staging/easycap: remove explicit NULL initialization
remove intializations to NULL where not needed and let the compiler find flows with unitilized variables. Fix one such flow in easycap_vma_fault function Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
6911e7e4a6
commit
b737f3b8cf
1 changed files with 3 additions and 8 deletions
|
@ -144,7 +144,6 @@ int rc;
|
||||||
JOT(4, "\n");
|
JOT(4, "\n");
|
||||||
SAY("==========OPEN=========\n");
|
SAY("==========OPEN=========\n");
|
||||||
|
|
||||||
peasycap = NULL;
|
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
#ifndef EASYCAP_IS_VIDEODEV_CLIENT
|
#ifndef EASYCAP_IS_VIDEODEV_CLIENT
|
||||||
if (NULL == inode) {
|
if (NULL == inode) {
|
||||||
|
@ -851,7 +850,7 @@ if (NULL != peasycap->purb_video_head) {
|
||||||
list_for_each_safe(plist_head, plist_next, peasycap->purb_video_head) {
|
list_for_each_safe(plist_head, plist_next, peasycap->purb_video_head) {
|
||||||
pdata_urb = list_entry(plist_head, struct data_urb, list_head);
|
pdata_urb = list_entry(plist_head, struct data_urb, list_head);
|
||||||
if (NULL != pdata_urb) {
|
if (NULL != pdata_urb) {
|
||||||
kfree(pdata_urb); pdata_urb = NULL;
|
kfree(pdata_urb); pdata_urb = NULL;
|
||||||
peasycap->allocation_video_struct -=
|
peasycap->allocation_video_struct -=
|
||||||
sizeof(struct data_urb);
|
sizeof(struct data_urb);
|
||||||
m++;
|
m++;
|
||||||
|
@ -2649,8 +2648,6 @@ struct page *page;
|
||||||
struct easycap *peasycap;
|
struct easycap *peasycap;
|
||||||
|
|
||||||
retcode = VM_FAULT_NOPAGE;
|
retcode = VM_FAULT_NOPAGE;
|
||||||
pbuf = NULL;
|
|
||||||
page = NULL;
|
|
||||||
|
|
||||||
if (NULL == pvma) {
|
if (NULL == pvma) {
|
||||||
SAY("pvma is NULL\n");
|
SAY("pvma is NULL\n");
|
||||||
|
@ -2686,16 +2683,15 @@ if (NULL == peasycap) {
|
||||||
pbuf = peasycap->frame_buffer[k][m].pgo;
|
pbuf = peasycap->frame_buffer[k][m].pgo;
|
||||||
if (NULL == pbuf) {
|
if (NULL == pbuf) {
|
||||||
SAM("ERROR: pbuf is NULL\n");
|
SAM("ERROR: pbuf is NULL\n");
|
||||||
goto finish;
|
return retcode;
|
||||||
}
|
}
|
||||||
page = virt_to_page(pbuf);
|
page = virt_to_page(pbuf);
|
||||||
if (NULL == page) {
|
if (NULL == page) {
|
||||||
SAM("ERROR: page is NULL\n");
|
SAM("ERROR: page is NULL\n");
|
||||||
goto finish;
|
return retcode;
|
||||||
}
|
}
|
||||||
get_page(page);
|
get_page(page);
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
finish:
|
|
||||||
if (NULL == page) {
|
if (NULL == page) {
|
||||||
SAM("ERROR: page is NULL after get_page(page)\n");
|
SAM("ERROR: page is NULL after get_page(page)\n");
|
||||||
} else {
|
} else {
|
||||||
|
@ -3192,7 +3188,6 @@ if (NULL == pusb_interface) {
|
||||||
SAY("ERROR: pusb_interface is NULL\n");
|
SAY("ERROR: pusb_interface is NULL\n");
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
}
|
}
|
||||||
peasycap = NULL;
|
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
/*
|
/*
|
||||||
* GET POINTER TO STRUCTURE usb_device
|
* GET POINTER TO STRUCTURE usb_device
|
||||||
|
|
Loading…
Add table
Reference in a new issue