mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
vme: vme_get_size potentially returning incorrect value on failure
The function vme_get_size returns the size of the window to the caller, however it doesn't check the return value of the call to vme_master_get. Return 0 on failure rather than anything else. Suggested-by: Dan Carpenter <[email protected]> Signed-off-by: Martyn Welch <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
cfcc1456e4
commit
6ad37567b6
1 changed files with 4 additions and 0 deletions
|
|
@ -156,12 +156,16 @@ size_t vme_get_size(struct vme_resource *resource)
|
|||
case VME_MASTER:
|
||||
retval = vme_master_get(resource, &enabled, &base, &size,
|
||||
&aspace, &cycle, &dwidth);
|
||||
if (retval)
|
||||
return 0;
|
||||
|
||||
return size;
|
||||
break;
|
||||
case VME_SLAVE:
|
||||
retval = vme_slave_get(resource, &enabled, &base, &size,
|
||||
&buf_base, &aspace, &cycle);
|
||||
if (retval)
|
||||
return 0;
|
||||
|
||||
return size;
|
||||
break;
|
||||
|
|
|
|||
Loading…
Reference in a new issue