mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
param: simple locking for sysfs-writable charp parameters
Since the writing to sysfs can free the old one, we need to block that when we access the charp variables. Signed-off-by: Rusty Russell <[email protected]> Reviewed-by: Takashi Iwai <[email protected]> Tested-by: Phil Carmody <[email protected]> Cc: Jeff Dike <[email protected]> Cc: Dan Williams <[email protected]> Cc: John W. Linville <[email protected]> Cc: Jing Huang <[email protected]> Cc: James E.J. Bottomley <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: Johannes Berg <[email protected]> Cc: David S. Miller <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected]
This commit is contained in:
parent
dca4130639
commit
d6d1b650ae
7 changed files with 24 additions and 0 deletions
|
|
@ -788,6 +788,7 @@ bfad_drv_init(struct bfad_s *bfad)
|
|||
memset(&driver_info, 0, sizeof(driver_info));
|
||||
strncpy(driver_info.version, BFAD_DRIVER_VERSION,
|
||||
sizeof(driver_info.version) - 1);
|
||||
__kernel_param_lock();
|
||||
if (host_name)
|
||||
strncpy(driver_info.host_machine_name, host_name,
|
||||
sizeof(driver_info.host_machine_name) - 1);
|
||||
|
|
@ -797,6 +798,7 @@ bfad_drv_init(struct bfad_s *bfad)
|
|||
if (os_patch)
|
||||
strncpy(driver_info.host_os_patch, os_patch,
|
||||
sizeof(driver_info.host_os_patch) - 1);
|
||||
__kernel_param_unlock();
|
||||
|
||||
strncpy(driver_info.os_device_name, bfad->pci_name,
|
||||
sizeof(driver_info.os_device_name - 1));
|
||||
|
|
|
|||
Loading…
Reference in a new issue