Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1794177imm; Thu, 24 May 2018 00:40:07 -0700 (PDT) X-Google-Smtp-Source: AB8JxZr+t0CAnpXuMkW46S6NHtsYkWNnvwiDepkpocbH0KHrPUmvW+YIMzMhOiQjtT8eb1+FHrCi X-Received: by 2002:a62:dc4e:: with SMTP id t75-v6mr6042231pfg.139.1527147607052; Thu, 24 May 2018 00:40:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527147607; cv=none; d=google.com; s=arc-20160816; b=GAJhQJJlsVBXN3MwL3BJ3B1MY1d4cWN+EyynjZlpngDWT1jiVZjrIaXOV81Htz4Yl0 Gi8FAmSNs9I51CUNm+mfVEQyx91AVF+IYm+7ZuTfUbIeAE8oIFk7VY8slKl/xChEGWlb nBEgUOeWNVEvxnJ4s9yzpcLCVdExi84RMa23gxth5YFh804HL3uE7ym0DIheDiT2iEqx WXfLZbIYWKtgkihfPULssu7t1DcDWgOZT9Y4hf3XraHDz8NsLbWYFJ/n6XUgdnNe41MZ KgbBkP1xcaMeabCKxbuVmBDP682X2lta0EibMrGO+vgrtJHuSbeNFDdrd9sCVHaD8pw9 PS2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=UpYhCQA+4LfU9SEyY9QFyHLQDKubBP3+/iqARsCj3z8=; b=0gUQ4nv+MG+w/liBbAyQA5VutFiRNOMKEZbEoKtbAVkOoU8oqiMAQA36bBvPDKfpOG FaIKH/ZiPm3RK/HDX9gIguurIAX+jWAB4ml7piGFoqZ5P3iYNY2dZwzS26vBSwM6dxZe hR8FpQnKHCMBCqqkXvjUUDjB7j+DTbnVLGOqbK/xDigyY/p18VKPOIAlsExl+W5wIpqa lHOPHf0ijMP4nkB+osI1xBh2m8Z6U1DV9pjMPts/DJuQDJI9uLa+PPHfb66GTaTDJN7f 0AaJuixut2/KkO4VQftizcvlO/tFth/49+axfyX1mfCb+qV0TnyrsGL4WK275XJlOB94 zszA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bf1-v6si4067681plb.484.2018.05.24.00.39.51; Thu, 24 May 2018 00:40:07 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935729AbeEXHeG (ORCPT + 99 others); Thu, 24 May 2018 03:34:06 -0400 Received: from metis.ext.pengutronix.de ([85.220.165.71]:53285 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964792AbeEXHeF (ORCPT ); Thu, 24 May 2018 03:34:05 -0400 Received: from pty.hi.pengutronix.de ([2001:67c:670:100:1d::c5]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1fLkl7-0007Jv-Gj; Thu, 24 May 2018 09:34:01 +0200 Received: from mgr by pty.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1fLkl6-0002nl-VZ; Thu, 24 May 2018 09:34:00 +0200 Date: Thu, 24 May 2018 09:34:00 +0200 From: Michael Grzeschik To: Shuah Khan Cc: linux-usb@vger.kernel.org, valentina.manea.m@gmail.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: Re: [PATCH v3] usbip: dynamically allocate idev by nports found in sysfs Message-ID: <20180524073400.qqwyy7zsihjjswse@pengutronix.de> References: <20180523092256.25922-1-m.grzeschik@pengutronix.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="qruuw5b52p5p2hdm" Content-Disposition: inline In-Reply-To: X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-Uptime: 09:32:13 up 153 days, 20:10, 75 users, load average: 0.10, 0.06, 0.01 User-Agent: NeoMutt/20170113 (1.7.2) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c5 X-SA-Exim-Mail-From: mgr@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --qruuw5b52p5p2hdm Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, May 23, 2018 at 10:44:57AM -0600, Shuah Khan wrote: > 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. > >=20 > > 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 > >=20 >=20 > 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. >=20 > I can't take this patch. I missed that get_nports depends on vhci_driver->hc_device which is not initialized that early. I will rework it to get the hc_device by parameter and send v4. Thanks, Michael --=20 Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | --qruuw5b52p5p2hdm Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEElXvEUs6VPX6mDPT8C+njFXoeLGQFAlsGat0ACgkQC+njFXoe LGQf6A/9EHkG4NJ39OCL/sPOIOVcpMpUpNygcirXau208M5Oc8GgW8xtJuBjJ+f2 2NrCBPeSKPvw70C0IfxjuDYKCQgIMO+HI8MWLhnFuzk+1+n+mF1zspA8EkRUdqZx S2b8myivm6E5G59ShSMj+skY9PtLOmoGOlE/QheuWqwD/GkTOFE449Zi+Z5rqOTz wc4q/u2ntr6ZlgTmcsIinfxBvW8Gs/B7GHGA8wGBsm25/BSI5vzDVfICJNpPOig1 gkMw6OghL8VhX/O6Es4KpP8vlvxk5y2zYnP5YpQ4gT//bFXoT6i6b5SEWCu1a0TK p9rUDlBzmgn0k06pr5jF80rUNFhZ/hakquWMoMKf88su3T9oy2/oIsuw3ZEIQxXP TRZq61d3d59vimT0zAfzeNz0Wx2zRxz7/KyqwLN8dvVj8hWcQ1cBYZDVB5VP9Nvd bSHUC5rYX27+xyJZ5jcBdZCV9M39yg0NF+L8FHX8LHOvUF72cx6kUYPxY7jzrzB4 IHxcwhaYsA/e/GtO0FqZsz74E5oTBnRs2Kju9maHJkm9J3aiFUxfWVMKybsYYek3 /GLSJFjeDdedaVksmV6bSvf/SIc0MMOMvQC4pw8jTz/5NVRnGqncYtkEo/lH+kBH 2Lxyhmih6K0vw/Jef7FJtyQEXumjt4oEPm/xme7dUQ8UCQRvZEI= =NuhD -----END PGP SIGNATURE----- --qruuw5b52p5p2hdm--