Re: [PATCH v4] usbip: dynamically allocate idev by nports found in sysfs

From: Shuah Khan
Date: Tue May 29 2018 - 17:29:13 EST


On 05/25/2018 08:23 AM, Michael Grzeschik wrote:
> As the amount of available ports varies by the kernels build
> configuration. To remove the limitation of the fixed 128 ports
> we allocate the amount of idevs by using the number we get
> from the kernel.
>
> Signed-off-by: Michael Grzeschik <m.grzeschik@xxxxxxxxxxxxxx>
> ---
> v1 -> v2: - reworked memory allocation into one calloc call
> - added error path on allocation failure
> v2 -> v3: - moved check for available nports to beginning of function
> v3 -> v4: - changed get_nports to get hc_device via parameter
> - moved calloc after valid get_nports call
>

Thanks. Looks good to me. It works now and doesn't segfault :)

Acked-by: Shuah Khan (Samsung OSG) <shuah@xxxxxxxxxx>

thanks,
-- Shuah