Re: [PATCH v7 3/5] test: add new driver_data load tester

AKASHI Takahiro
2017-05-11T10:06:18Z

Luis,

On Tue, May 02, 2017 at 01:49:12AM -0700, Luis R. Rodriguez wrote:
>
> diff --git a/lib/test_driver_data.c b/lib/test_driver_data.c
> new file mode 100644
> index 000000000000..488cc6e9eed4
> --- /dev/null
> +++ b/lib/test_driver_data.c

...

> +static int trigger_config_sync(struct driver_data_test_device *test_dev)
> +{
> + struct test_config *config = &test_dev->config;
> + int ret;
> + const struct driver_data_req_params req_params_default = {
> + DRIVER_DATA_DEFAULT_SYNC_REQS(config_sync_req_cb, test_dev,
> + DRIVER_DATA_REQ_OPTIONAL |
> + DRIVER_DATA_REQ_KEEP)

Are these flags always on?

> +void free_test_dev_driver_data(struct driver_data_test_device *test_dev)
> +{
> + kfree_const(test_dev->misc_dev.name);
> + test_dev->misc_dev.name = NULL;
> + vfree(test_dev);
> + test_dev = NULL;
> + driver_data_config_free(test_dev);

Removing this test module fails.

The last three lines should be:
driver_data_config_free(test_dev);
vfree(test_dev);

> +}
> +
> +void unregister_test_dev_driver_data(struct driver_data_test_device *test_dev)
> +{
> + wait_for_completion_timeout(&test_dev->request_complete, 5 * HZ);
> + dev_info(test_dev->dev, "removing interface\n");
> + misc_deregister(&test_dev->misc_dev);
> + kfree(&test_dev->misc_dev.name);

Don't need this kfree().

Thanks,
-Takahiro AKASHI