Change return type of libx52_hotplug_exit

There is really no need for a return code, if the service pointer is
NULL, or any of the parameters are NULL, then simply return.
debian-packaging
nirenjan 2020-04-18 01:23:41 -07:00
parent d45b1f7bfd
commit 79b1f930b8
1 changed files with 2 additions and 4 deletions

View File

@ -249,9 +249,9 @@ err_recovery:
return rc; return rc;
} }
int libx52_hotplug_exit(libx52_hotplug_service *svc) { void libx52_hotplug_exit(libx52_hotplug_service *svc) {
if (svc == NULL || svc->dev == NULL || svc->callbacks == NULL) { if (svc == NULL || svc->dev == NULL || svc->callbacks == NULL) {
return LIBX52_ERROR_INVALID_PARAM; return;
} }
/* Deregister the callback handle */ /* Deregister the callback handle */
@ -276,8 +276,6 @@ int libx52_hotplug_exit(libx52_hotplug_service *svc) {
/* Clear the service pointer before freeing it */ /* Clear the service pointer before freeing it */
memset(svc, 0, sizeof(*svc)); memset(svc, 0, sizeof(*svc));
free(svc); free(svc);
return LIBX52_SUCCESS;
} }
int libx52_hotplug_register_callback(libx52_hotplug_service *svc, int libx52_hotplug_register_callback(libx52_hotplug_service *svc,