[igt-dev] [PATCH i-g-t v3 3/6] lib/igt_kmod: improve audio unbind logic

Andi Shyti andi.shyti at linux.intel.com
Mon May 16 12:30:58 UTC 2022


Hi Mauro,

> +	/* Recursively remove all drivers that depend on drm_driver */
> +	for (j = 0; j < mod[i].num_required; j++) {
> +		pos = mod[i].required_by[j];
> +		if (who)
> +			*who = strdup(mod[pos].name);

how many who are we "strdupping"? Are they freed anywhere?

Andi

> +		/*
> +		 * If a sound driver depends on drm_driver, kill audio processes
> +		 * first, in order to make it possible to unload the driver
> +		 */
> +		if (strstr(mod[pos].name, "snd")) {
> +			if (igt_lsof_kill_audio_processes()) {
> +				ret = EACCES;
> +				goto ret;
> +			}
> +		}
> +		ret = igt_unload_driver(mod, num_mod, pos);
> +	}
> +
> +ret:
> +	free_module_ref(mod, num_mod);
> +
> +	return ret;
> +}


More information about the igt-dev mailing list