Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp920437pxb; Sun, 21 Feb 2021 05:10:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJwd7qtvI3Uec4fdgZmEwPWQT5ggmAremkr53B4gEyMslC7OsZmyXakYbyr+A4pEKl3vj51h X-Received: by 2002:a05:6402:519:: with SMTP id m25mr16428292edv.289.1613913006672; Sun, 21 Feb 2021 05:10:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613913006; cv=none; d=google.com; s=arc-20160816; b=DsTwY0kNPBBgBvsu44W3kO3Sxkw0xDKoO4/NjZqHh4bXY4Uf3CzDjSbgGVye/vTzvk mY2XjL0awi6C9Zczlgd/g83KtGHepCIqOH9N+hQvCkg+xyno6gco9HlhJ1CX/uJ+ktg0 LJ1BlSPiD6mMbyHIInGtihJbbRiOC5AfL7SXP/cXMdu3PRQ8UWBWzxlEe56Lg7KZrZqv yxn91NVAFNOz/4zdJn3ozAE+ymWiYxH5+S/VmZ5VOX+BSaEWfTwHNqVrI2SCQw+KXtfE 7+9PfEyccQ4GaZR/Hgd4+UcT4jf9BUNGzYdtzRfZN212U7UvxdGDJsMs9CPL3srOBpDO QAzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=xDE94HTjpJhxdgJdZrraiRSOfuBBVQjIOIdw5NjG/68=; b=mRJnRccjL67To9RFMvT6l8yEHTww152htKdC0M56KW+Srb/RbpEFUGphgwcKeVgo4y YCN82Z2aNtp5G2XbIPE8oeJxQKIZFlGQ5uI/bsvnYfzGECKi5VjwYg0cTjt5RW7BYo7q GkSoW38ZDsrkBCEx7WduN9eLeXoZNBPALvUBpX7wCqIJllZaFzlQjiwnhMiz2XO8dT+G saDe3HqNiswDJNbE7zrYtdDcq/75zDVP54DdULFuiYx32q20QN+dJPoiiWbUNyGKp8ym eg+pb9K9UfqfnquBZTa3EnpbaUVlKktBjeRsVUzSSqEJ/Yt+KXTZ/NY2+8H1MzGi0x0O jEjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ai0wRaZ+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c9si9896067edq.47.2021.02.21.05.09.44; Sun, 21 Feb 2021 05:10:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ai0wRaZ+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229973AbhBUNJJ (ORCPT + 99 others); Sun, 21 Feb 2021 08:09:09 -0500 Received: from mail.kernel.org ([198.145.29.99]:47566 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229949AbhBUNJI (ORCPT ); Sun, 21 Feb 2021 08:09:08 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id D4E9A60238; Sun, 21 Feb 2021 13:08:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1613912908; bh=vShBavP/ZvJGfxTF4LtPmeATUmF+zCbq/l6boSMYzXg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ai0wRaZ+otq64Ial1tJ+iC+hWflcUKYF3WcKACAGTFRAeEbiv1zYZf3i6vtOVl4bC T3/JHbJlHZJan3vWXM3xrIQTtp0rczrJL3pis5HQ3nxa4T4GngQOWflgikyH7i6o2u 1EijHEnhYFJIFW6fGcppuj7u9wwvPaGBKMuVQXro= Date: Sun, 21 Feb 2021 14:08:26 +0100 From: Greg KH To: Atul Gopinathan Cc: tiwai@suse.de, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, gustavo@embeddedor.com Subject: Re: [PATCH 2/2] staging: rtl8192e: Change state information from u16 to u8 Message-ID: References: <20210220182154.9457-1-atulgopinathan@gmail.com> <20210220182154.9457-2-atulgopinathan@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210220182154.9457-2-atulgopinathan@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Feb 20, 2021 at 11:51:55PM +0530, Atul Gopinathan wrote: > The "CcxRmState" field in struct "rtllib_network" is defined > as a u16 array of size 2 (so, 4 bytes in total). > > But the operations performed on this array throughout the code > base (in rtl8192e/) are all in byte size 2 indicating that this > array's type was defined wrongly. > > There are two situation were u16 type of this field could yield > incorrect behaviour: > > 1. In rtllib_rx.c:1970: > memcpy(network->CcxRmState, &info_element->data[4], 2); > > Here last 2 bytes (index 4 and 5) from the info_element->data[] > array are meant to be copied into CcxRmState[]. > Note that "data" array here is an array of type u8. > > 2. In function "update_network()" in staging/rtl8192e/rtllib_rx.c: > memcpy(dst->CcxRmState, src->CcxRmState, 2); > > Here again, only 2 bytes are copied from the source state to > destination state. > > There are no instances of "CcxRmState" requiring u16 data type. > Here is the output of "grep -IRn 'CcxRmState'" on the rtl8192e/ > directory for reviewing: > > rtllib_rx.c:1970: memcpy(network->CcxRmState, &info_element->data[4], 2); > rtllib_rx.c:1971: if (network->CcxRmState[0] != 0) > rtllib_rx.c:1975: network->MBssidMask = network->CcxRmState[1] & 0x07; > rtllib_rx.c:2520: memcpy(dst->CcxRmState, src->CcxRmState, 2); > rtllib.h:1108: u8 CcxRmState[2]; You just changed the logic in line 1975 in that file, right? Are you _SURE_ that is ok? Do you have a device to test this on? thanks, greg k-h