Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp474555lqb; Wed, 17 Apr 2024 01:48:18 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXHDIW1ER2oyvBm0B7rsnEFRXZMzEuEj22Zy1H4YMmC3jkBUs8IoAvrVJYNrxocRMOYeP50AAsaC8g5N3p1z2yUzUbCltgdccb1rEuFpA== X-Google-Smtp-Source: AGHT+IG2FJ9L8WfuOs4Uvx6vkIrshjj3RBd3y1WHeCiy+PcpMWpWkDkAhs6B4EXGDsdaKfVHr60J X-Received: by 2002:a17:902:e80f:b0:1e2:b137:4f88 with SMTP id u15-20020a170902e80f00b001e2b1374f88mr21425708plg.30.1713343698445; Wed, 17 Apr 2024 01:48:18 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713343698; cv=pass; d=google.com; s=arc-20160816; b=swFlQ+el6TORcL4dTgGNvJRzxVFIcBLO/dVbYYBWQ97mcUrrAOLEkEKPLPvkOQ1+kQ qyN7GyWU8tKCHnWyoD/xYxqYhCi9ZNzSsqHULT4Y0Pi1ySaoqAOPTML2LSIUuw6BChWU FnSjU/1EuTZId7p5qIoJ0D5ECMX4Fy3lWZQ1+j2YYxXmtwbd6Wkdgdh0zBPCdIwKsZrS hZ8HmlOjFS149SlF6OloMNgz5Q8u7CwKt7aaCikelLNPet6FGeLndVgh/BTW/N3ltPQ4 +Lv/7EKAoD0RMHc2+vZEfgtMS799uw3ApQFAtAlifVFctrwvgxN6e4XiNrskMm/VvKuC iyEA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=49PQg0YTunPGqzjsEwzJbZPNhnb5Xvd96h0eVOAPaRs=; fh=+WvOHspnUMS7+WPE1eC1OI/YLBQMMi7Bnqs8WxCWLnQ=; b=bH/w7JeGNzQdch1xBXWnrCOWfGYIJAbKgyzbw12FPHtzm8nBaaFAn1NgoDQRhIB5IP pxEmFznQdbAHGNwYKkaX2b5VURlchrA0M6PJhX+Klx0YHFPnV+6KAMVJJ19nhyqclwpt znqnLkd7bwTvpsaHnIgf/H4GWLeqHO8//fg3cTcS2La5OJFFpzN9jooOY1CNcbZt0iCU chx2Pw7yDaBptK+XHY4cOPEzxUE+QUZH+S3vEVeHyS9D7veqO6VnPb/NECNO+3Mn4eDd Q1ItacelxW+DVQQVY2186pT/wRgfS1ooAh35pTjGXJ5Ys//NaFp5A67cT0h3YhpgL8MH uNvg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mHOyC78w; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-bluetooth+bounces-3661-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-3661-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id t16-20020a17090340d000b001e2b16381f2si11175512pld.424.2024.04.17.01.48.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Apr 2024 01:48:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-3661-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mHOyC78w; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-bluetooth+bounces-3661-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-3661-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id C4B5AB25344 for ; Wed, 17 Apr 2024 08:33:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 83F13126F38; Wed, 17 Apr 2024 08:32:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="mHOyC78w" X-Original-To: linux-bluetooth@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E82355D8F6 for ; Wed, 17 Apr 2024 08:32:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713342778; cv=none; b=YUdD9nHOWQZdb9rF9biOd0L6OwZZ/WNFEbSY3A90sT92nlZ8v+t+EOP5npKjZhdlKgcaPfB+lcM4kSfcpTAV9TQ152zy2Dk6z02HuVLcg7V/EpBTcdgqkztoWCVtKTq7y1X1HP3i6IroV+0wdZDFtPtYJrTaFwa/3IeZa/uf0N4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713342778; c=relaxed/simple; bh=UuKCGZDfBb+rnhrXIbZN/cR/ZQTWM20t989TnEUTvFE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=gWavOL27az94hvnHQkZN+zwDkAYzm3+uiIlnywti9o7DAxXKHtN9YU0Elkqw3r9HGsGxQrc3fTVUTod22qTFKcZXxwKb1s7WWf4tq05bfxgCZdR/jGkxfN7RFF0GV0AECgfFbaKkRPPMibNtCvRVaaLB2oSq6rRtR80wDFXdrRg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=mHOyC78w; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 76DB0C072AA; Wed, 17 Apr 2024 08:32:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713342777; bh=UuKCGZDfBb+rnhrXIbZN/cR/ZQTWM20t989TnEUTvFE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=mHOyC78wcx5xAycMXkJLkZhqXwkFoOjSHyLDDTWx/wBKLeYvdPJs2DCiAJpfVzvMF HICDK61uk5WH1h/ua3G02ws2hRkxaSaPBYGTljhkCJeJdeRT/QhukxfYbb8jfHhG+R Eiqdwn0SoZe69bP42qp8trPvqPKl+6qk4U2NN0o40uuOOIpi1MT1rlwQX5JDETKg/M nir/rVAkPGgpe3Jy8qNM13niLh+qtdHwMyiqJofqZHld371dg10ZBw7hbNkZ74YL6X T7cyBvK7Nj6SQlOOqc3uk2L4uPBlpYAnOGTAVX0j+EvmvRYRBg7UEhYwRz7BDdUTe2 en+JX05kLT7dg== Received: from johan by xi.lan with local (Exim 4.97.1) (envelope-from ) id 1rx0it-00000000849-44fj; Wed, 17 Apr 2024 10:32:56 +0200 Date: Wed, 17 Apr 2024 10:32:55 +0200 From: Johan Hovold To: quic_zijuhu Cc: luiz.dentz@gmail.com, marcel@holtmann.org, linux-bluetooth@vger.kernel.org, johan+linaro@kernel.org Subject: Re: [PATCH] Bluetooth: qca: Fix nullptr dereference for non-serdev devices Message-ID: References: <1713325792-17181-1-git-send-email-quic_zijuhu@quicinc.com> <5e4e62c8-d17f-45fd-9212-088eb026dc7b@quicinc.com> <4dac0caa-629d-4b4d-ad54-f6ab15268524@quicinc.com> Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4dac0caa-629d-4b4d-ad54-f6ab15268524@quicinc.com> Again, make sure wrap you replies at 72 cols and trim unnecessary context: https://docs.kernel.org/process/submitting-patches.html#use-trimmed-interleaved-replies-in-email-discussions On Wed, Apr 17, 2024 at 03:32:51PM +0800, quic_zijuhu wrote: > On 4/17/2024 3:10 PM, Johan Hovold wrote: > > On Wed, Apr 17, 2024 at 02:51:38PM +0800, quic_zijuhu wrote: > >> i have submitted below patches to add supports for all other > >> non-serdev controllers. > > > >> https://patchwork.kernel.org/project/bluetooth/list/?series=844120 > > > > Ok, you need it for some future changes, but I'm afraid that adding new > > random vendor specific ioctls like you do in that is series is a no-go. > it is a generic ioctl, for QCA, it is used to specific soc_type. it > maybe be used by other vendor driver to set user specified info. In it's current form it's a vendor specific hack that is never going to make it upstream. For a start, you don't even make sure that the types becomes part of the ABI, which means that passing, say, type 5 can mean different things depending on the kernel version. Can't you just retrieve the device type from the device itself? If it's already powered, you should not need to know this beforehand. Johan