Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3820214imm; Tue, 29 May 2018 14:29:57 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKf7UGbBAtBYW8+ngY+zyclN8YbcU2ucs2T98WEOISsie02UYwatE4G8PPSz4rFBwWX3OA0 X-Received: by 2002:a63:7f5c:: with SMTP id p28-v6mr90016pgn.64.1527629397082; Tue, 29 May 2018 14:29:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527629397; cv=none; d=google.com; s=arc-20160816; b=EP35/ZBvXxjBWhkCpF65cOYuEuAvyIGV36MzQPx61w9HfUsXz7M1ywZrvWlsfc+k+Y GdIhtqaluoSdUFvljLZB36ghTR9vYCUy23/F6dxxPqOL3GhySIQ2gpxjJCMBM+GDsr9O NrHLjaZ0SUw+WnINbFmh5gVJhXEkDEOFRiG2WreqHaI6aelw937uRSu0nRps7cBbfUiP qvINKoccuXFpGMKidNX9j4iJ94AgN56RMGUdzrMPZj75sWpWyg4yTqqOeUGYPXyFE66L /V1Gq9P0TdMBVH5EuqWKZg1ftAq748Oj+JyQHkuxE3Y/UDVS871QA/MOckQg8mmPrrQ7 37FQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=xfXmgB4BrOSHXI4V1Tu2SOyLj/asFUxAQfCjVLXtE0A=; b=Pr9OKu9k7HIJDtgnu1VbAN3jlWVI48pUSIAUVYaj/PQLf1T75kRnzvIS8o2gGvgsI6 t1LsCDo0ttWGxApn/fzy6qnXp9QrML6G3JmBFwXLujce7SX3PHGMoH8FGYuGV94K7mSI 3OeSCeYVCaaLo/b8/jd3zDNcO2SBB1tRdSlWViST5mvVwFOI32QlpDiXkXL6qbBW4uar zY0qcbjMYmsLEEsNjSNSK70M/XYNtDaiOTEqx08wFJCrm/stkVLraH12eb0xoM1Enqj1 +JLkCFQ/JjbAxzQrp1AX6phQ18tUEO7A/LgW0SHqIzv/0WbKd2CJIrgMyaaXzfFFd6aC sKtQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w15-v6si26249673pgq.385.2018.05.29.14.29.43; Tue, 29 May 2018 14:29:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967207AbeE2V3H (ORCPT + 99 others); Tue, 29 May 2018 17:29:07 -0400 Received: from mailout.easymail.ca ([64.68.200.34]:41405 "EHLO mailout.easymail.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967011AbeE2V3G (ORCPT ); Tue, 29 May 2018 17:29:06 -0400 Received: from localhost (localhost [127.0.0.1]) by mailout.easymail.ca (Postfix) with ESMTP id 39DDC21D51; Tue, 29 May 2018 21:29:05 +0000 (UTC) Received: from mailout.easymail.ca ([127.0.0.1]) by localhost (emo02-pco.easydns.vpn [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VTCHecTAR8VF; Tue, 29 May 2018 21:29:05 +0000 (UTC) Received: from [192.168.1.87] (c-24-9-64-241.hsd1.co.comcast.net [24.9.64.241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mailout.easymail.ca (Postfix) with ESMTPSA id 6E7BC21D4F; Tue, 29 May 2018 21:28:56 +0000 (UTC) Subject: Re: [PATCH v4] usbip: dynamically allocate idev by nports found in sysfs To: Michael Grzeschik , linux-usb@vger.kernel.org Cc: valentina.manea.m@gmail.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de, Shuah Khan References: <20180525142346.6591-1-m.grzeschik@pengutronix.de> From: Shuah Khan Message-ID: Date: Tue, 29 May 2018 15:28:55 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180525142346.6591-1-m.grzeschik@pengutronix.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > 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) thanks, -- Shuah