mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-04 17:44:14 +08:00
Staging driver fixes for 5.17-rc4
Here are 2 staging driver fixes for 5.17-rc4. These are: - fbtft error path fix - vc04_services rcu dereference fix Both of these have been in linux-next for a while with no reported issues Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> -----BEGIN PGP SIGNATURE----- iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCYgeKDg8cZ3JlZ0Brcm9h aC5jb20ACgkQMUfUDdst+ynaBQCgrJLuinqny9Gfub/ZllXmn3zDLB4Ani5v+Cg+ Muq0L6io5S8TB9uk24Q0 =+fd7 -----END PGP SIGNATURE----- Merge tag 'staging-5.17-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging Pullstaging driver fixes from Greg KH: "Here are two staging driver fixes for 5.17-rc4. These are: - fbtft error path fix - vc04_services rcu dereference fix Both of these have been in linux-next for a while with no reported issues" * tag 'staging-5.17-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: staging: fbtft: Fix error path in fbtft_driver_module_init() staging: vc04_services: Fix RCU dereference check
This commit is contained in:
commit
dcd72f5466
@ -334,7 +334,10 @@ static int __init fbtft_driver_module_init(void) \
|
||||
ret = spi_register_driver(&fbtft_driver_spi_driver); \
|
||||
if (ret < 0) \
|
||||
return ret; \
|
||||
return platform_driver_register(&fbtft_driver_platform_driver); \
|
||||
ret = platform_driver_register(&fbtft_driver_platform_driver); \
|
||||
if (ret < 0) \
|
||||
spi_unregister_driver(&fbtft_driver_spi_driver); \
|
||||
return ret; \
|
||||
} \
|
||||
\
|
||||
static void __exit fbtft_driver_module_exit(void) \
|
||||
|
@ -1058,15 +1058,27 @@ service_callback(enum vchiq_reason reason, struct vchiq_header *header,
|
||||
|
||||
DEBUG_TRACE(SERVICE_CALLBACK_LINE);
|
||||
|
||||
rcu_read_lock();
|
||||
service = handle_to_service(handle);
|
||||
if (WARN_ON(!service))
|
||||
if (WARN_ON(!service)) {
|
||||
rcu_read_unlock();
|
||||
return VCHIQ_SUCCESS;
|
||||
}
|
||||
|
||||
user_service = (struct user_service *)service->base.userdata;
|
||||
instance = user_service->instance;
|
||||
|
||||
if (!instance || instance->closing)
|
||||
if (!instance || instance->closing) {
|
||||
rcu_read_unlock();
|
||||
return VCHIQ_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* As hopping around different synchronization mechanism,
|
||||
* taking an extra reference results in simpler implementation.
|
||||
*/
|
||||
vchiq_service_get(service);
|
||||
rcu_read_unlock();
|
||||
|
||||
vchiq_log_trace(vchiq_arm_log_level,
|
||||
"%s - service %lx(%d,%p), reason %d, header %lx, instance %lx, bulk_userdata %lx",
|
||||
@ -1097,6 +1109,7 @@ service_callback(enum vchiq_reason reason, struct vchiq_header *header,
|
||||
bulk_userdata);
|
||||
if (status != VCHIQ_SUCCESS) {
|
||||
DEBUG_TRACE(SERVICE_CALLBACK_LINE);
|
||||
vchiq_service_put(service);
|
||||
return status;
|
||||
}
|
||||
}
|
||||
@ -1105,10 +1118,12 @@ service_callback(enum vchiq_reason reason, struct vchiq_header *header,
|
||||
if (wait_for_completion_interruptible(&user_service->remove_event)) {
|
||||
vchiq_log_info(vchiq_arm_log_level, "%s interrupted", __func__);
|
||||
DEBUG_TRACE(SERVICE_CALLBACK_LINE);
|
||||
vchiq_service_put(service);
|
||||
return VCHIQ_RETRY;
|
||||
} else if (instance->closing) {
|
||||
vchiq_log_info(vchiq_arm_log_level, "%s closing", __func__);
|
||||
DEBUG_TRACE(SERVICE_CALLBACK_LINE);
|
||||
vchiq_service_put(service);
|
||||
return VCHIQ_ERROR;
|
||||
}
|
||||
DEBUG_TRACE(SERVICE_CALLBACK_LINE);
|
||||
@ -1137,6 +1152,7 @@ service_callback(enum vchiq_reason reason, struct vchiq_header *header,
|
||||
header = NULL;
|
||||
}
|
||||
DEBUG_TRACE(SERVICE_CALLBACK_LINE);
|
||||
vchiq_service_put(service);
|
||||
|
||||
if (skip_completion)
|
||||
return VCHIQ_SUCCESS;
|
||||
|
Loading…
Reference in New Issue
Block a user