From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-189.mta1.migadu.com (out-189.mta1.migadu.com [95.215.58.189]) (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 163E22749DF for ; Sun, 4 Jan 2026 10:29:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.189 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767522583; cv=none; b=s7+Dc7y3AFXuGZ8XtJRthfnJVYdxZ4B4u5Qq5AG0JjNTfBJTDZl7Aa+SryEvqR7NKxifLVlCq3/ZiylZ+3vufDjalnxGZz1Gw5oayQe9TSY+roRSyglNBGUE59ixWLz+LQ4hy/J9OsyK2UnoJQOrfu+APXYOVghShF0ha059Hg0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767522583; c=relaxed/simple; bh=Mvvit+d4BvijoMQKqR0H8HpTJFUH94G3hJg3sO9ScU8=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=pKohG9oMtsfHajmjvJhrJacxj4Jfe6VIjQLiE2t2laqLhGyd8JGZtBsuDVraK4FrgZrkwFJxI3mh2kZyiQzlZhpAZz8iLeDjjtHVkd46Hk6dEoO6ME4zxhrNJ436PYRmFTmMF4mGk+FQNtOanB1XydxycLLbIzsJATUaxuCRm6Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=pbhhV190; arc=none smtp.client-ip=95.215.58.189 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="pbhhV190" Message-ID: <1814efa2-0b4c-42a5-a18a-eca5638cdd43@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1767522576; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9OGZWrSK/pBZyPvguxbiLvLVKORor8gaxhxXKMup7zw=; b=pbhhV1905EQt9JEVAb1+D7LOOo/2UGmxJ3nRvamrlQZNFtu2Kl314pfwqXRKJW6gEZFSWw Z4LiNBz2zgBM+bpN4YfKbfMTRQfBZLD1zteV9yywb2W7MTI/nnIM02LqU2Q/DKt11lmZ46 qSAncGxEYUxMMoEn+e47fddbx1rmjSc= Date: Sun, 4 Jan 2026 10:29:25 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH v2] net: mediatek: add null pointer check for hardware offloading To: Andrew Lunn , Sebastian Roland Wolf , Elad Yifee Cc: Felix Fietkau , Sean Wang , Lorenzo Bianconi , Andrew Lunn , Matthias Brugger , AngeloGioacchino Del Regno , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Sebastian Roland Wolf References: <20260103005008.438081-1-Sebastian.Wolf@pace-systems.de> <6491ccf8-0318-421e-ba44-1565875e374c@lunn.ch> Content-Language: en-US X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Vadim Fedorenko In-Reply-To: <6491ccf8-0318-421e-ba44-1565875e374c@lunn.ch> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT On 03/01/2026 08:30, Andrew Lunn wrote: > On Sat, Jan 03, 2026 at 01:50:08AM +0100, Sebastian Roland Wolf wrote: >> From: Sebastian Roland Wolf >> >> Add a null pointer check to prevent kernel crashes when hardware >> offloading is active on MediaTek devices. >> >> In some edge cases, the ethernet pointer or its associated netdev >> element can be NULL. Checking these pointers before access is >> mandatory to avoid segmentation faults and kernel oops. > > Would it make sense to return EOPNOTSUPP, or maybe ENODEV? This does > seem like an error case. The if condition checks for single device only, while the code was added with introduction of multiple PPEs. I believe we have to check multiple devices from eth[], but the author may know better (CCed Elad Yifee) > > Andrew