Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1068604imm; Wed, 23 May 2018 09:46:00 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqMEP2RXb+/47w94U+qv3CaWouaAwGDNWuG2WXZkXw/r3zTlR3G8ExlVkySo4/UwnKW+QcY X-Received: by 2002:a63:7a11:: with SMTP id v17-v6mr2697873pgc.97.1527093960591; Wed, 23 May 2018 09:46:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527093960; cv=none; d=google.com; s=arc-20160816; b=g2y27a5yu1gETk8Kc88vur9jM9t6hpbulLNcSakxB7ip5mLbXtICDFUnr1hhmY1TzJ VC8sg1JtFCE859qJ7+QXiS11MDB2zw/11zVayUX4STSnkLjcZwyD2Q9VAwdGBdBZmxHm 25WiZdUwb8nEjOvddBazhhMGBf37VTmEYOFVPMJx58q4cmF9serx4SMrN9o0ZJ7DDB71 /cqPQeodyU4ErCJJGNu8ZO+fizxFbqUb49c5PCEQXWhBeUqQD7jW93uewzlpyWXxX7hT mbL/gEogItl4QgQlm4h/0D1p/4qxJW7uUrHBy2mHKbnjbpqFpmOe7pAh1L4WTOjvNkJb SmtQ== 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=y0QA3EkEnK3FS6Tek420ObNX67uRZfibqE4FuPm1IlE=; b=ocvM1pbXSQuN/v39iUbcbzkXasejd2uLn5JHPhZ0Ds27j1GkPYkfl15uwldfSe4BAr ss454uL7iV6Vk5Cw/ZK+y/jol/+QCJMr+gv0xG7IP8DirDTm1letOiHauBV4jKQaWCQ9 G4nrzJGRrMAO+F1sj2xByKmYpb+d8T+cHpGMabeokCHGSkloyhRpqluP8s+Dqq+RW/qC jheyHTA+NrB6eOBh7VztP3v/dpyR+BY8B/IAemrLeWIqq0WzC1whBy7BTVVvCAj5YsR6 i8seP4Vk4CmISjwT4ID+zdRCGyMIwgzlgXYl/lpaiaFupsr3Aol2K65Y25fz92kYbu/A rV5w== 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 g6-v6si15129097pgs.396.2018.05.23.09.45.45; Wed, 23 May 2018 09:46:00 -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 S1754754AbeEWQpW (ORCPT + 99 others); Wed, 23 May 2018 12:45:22 -0400 Received: from mailout.easymail.ca ([64.68.200.34]:42985 "EHLO mailout.easymail.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754623AbeEWQpT (ORCPT ); Wed, 23 May 2018 12:45:19 -0400 Received: from localhost (localhost [127.0.0.1]) by mailout.easymail.ca (Postfix) with ESMTP id BD16F214A9; Wed, 23 May 2018 16:45:18 +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 iyGhZlT9VXpz; Wed, 23 May 2018 16:45:18 +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 630982149D; Wed, 23 May 2018 16:45:09 +0000 (UTC) Subject: Re: [PATCH v3] 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: <20180523092256.25922-1-m.grzeschik@pengutronix.de> From: Shuah Khan Message-ID: Date: Wed, 23 May 2018 10:44:57 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180523092256.25922-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/23/2018 03:22 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 > Hmm. With this patch I see a segfault when I run usbip port command. I think this patch is incomplete and more changes are needed to the code that references the idev array. I can't take this patch. thanks, -- Shuah