Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp68706pxy; Tue, 27 Apr 2021 23:03:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwselWkJJKGrGiEP2Rhv2NhqwrN86b3TwPOTvpFAy5+TNfK+n7rwkwdZpVC2aACptkMqz+B X-Received: by 2002:a17:907:16a9:: with SMTP id hc41mr27573945ejc.84.1619589830790; Tue, 27 Apr 2021 23:03:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619589830; cv=none; d=google.com; s=arc-20160816; b=KUcvjUmmzbfK5Pay5XPpab+tE0bWL+exsFI/9oluiwid39vsajwU1zQ86crGeZapz6 DxOkM8iNq/NaghMR5qZVABFlpPua+JZhP5LTalWg8PVRIRYGjKqJ0rvBViujyrYRHAwO AEiBaF071VTq0QfwVvDSgNYWWyrhF5dARmxzeOCxBjXI1ydzw1PZxvQRKhKnHTj3c5uU gjR9RFzX6wK+YEYmalU+imJggOY1PjLcvXkkWjZ9nnk0ZqsOferukiAwI1pYFZzX6JlO RCYlsgDC3BFcwy8+QOLDscJIbLlD28knUeagVjIC7yc6WER7V/B87+0ueIQYaYhhgovz OFFA== 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=CRFBQDIQ7Sm8xpl5CbaaVfXsKuC2B/KOmW8ledecH5s=; b=Y2IMHog1kT54ZgKPIT0qoXlhpoVjRJF/wNOMdSv1RQcb5+KupdUSbptjDk8t65N3LQ Dp9oAtjimpTqRCBIXEggV94HMWQ1to0EyVsL3usl36kCHmnkTyeW2jeCTOYXNSgR9/ma Ilh0YfqPVHFsnIHENnpRjuHxbQBZd2F0+J2Zk7CU0QWvBv9e9hXd5zg3Rqwl6HOJ7lAI CQTTKoMR2Y/zNXbml4HeVed9nZxmyfwcdxwIZinfGGNLxlB/kmrlUYeNr+65TKNieeNN RKs1zeEQHZsAembIuGCp3fGo2bS9Ya63UoTmK2GBh8+vyr7h0jWFt05jHul8E07uZ/w8 tCPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=h1Qj0gdC; 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 t18si1889268eje.268.2021.04.27.23.03.27; Tue, 27 Apr 2021 23:03:50 -0700 (PDT) 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=h1Qj0gdC; 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 S234334AbhD1GCL (ORCPT + 99 others); Wed, 28 Apr 2021 02:02:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:40548 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229643AbhD1GCK (ORCPT ); Wed, 28 Apr 2021 02:02:10 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 93EB761418; Wed, 28 Apr 2021 06:01:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1619589686; bh=DMvmZdizmahSdLy38H1KdUaziGayCrN6I19m9A9ZYWs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=h1Qj0gdCXNxTtk/HV/D/SXrBefjYaeC7pF9jVQ9iWIol9/BoLQP3cS29/mwIlT8s2 3IqWOD4X8waD+h3iJ7xJfdKEe2xzt2fCCxOdhNMCjNgqCpATrShKx0PW2/uXghnG+r ojF5TFt+zEZFImtiVhyshYWglV3bSokT8q7wNkNw= Date: Wed, 28 Apr 2021 08:01:21 +0200 From: Greg KH To: Jitendra Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] staging: rtl8192e: fix array of flexible structures Message-ID: References: <20210427174945.1323-1-jkhasdev@gmail.com> <20210427185844.GA1030@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210427185844.GA1030@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 28, 2021 at 12:28:44AM +0530, Jitendra wrote: > On Tue, Apr 27, 2021 at 08:10:20PM +0200, Greg KH wrote: > > On Tue, Apr 27, 2021 at 11:19:45PM +0530, Jitendra Khasdev wrote: > > > This patch fixes sparse warning "array of flexible structures" > > > for rtllib.h. > > > > > > eg. drivers/staging/rtl8192e/rtllib.h:832:48: warning: array of > > > flexible structures > > > > > > Signed-off-by: Jitendra Khasdev > > > --- > > > drivers/staging/rtl8192e/rtllib.h | 10 +++++----- > > > 1 file changed, 5 insertions(+), 5 deletions(-) > > > > > > diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h > > > index 4cabaf2..c7cb318 100644 > > > --- a/drivers/staging/rtl8192e/rtllib.h > > > +++ b/drivers/staging/rtl8192e/rtllib.h > > > @@ -802,7 +802,7 @@ struct rtllib_authentication { > > > __le16 transaction; > > > __le16 status; > > > /*challenge*/ > > > - struct rtllib_info_element info_element[]; > > > + struct rtllib_info_element *info_element; > > > > You just changed the definition of this structure, and the other > > structures here. Are you sure this is working properly? > > > > I have compiled the driver and install it on my vm, but I don't this specific > hardware, so couldn't test it. > > I fixed in context of sparse. Please verify that this change is correct by looking at how the structures are being created (i.e. is this being treated as a flexible array or a pointer?) I think we have been through this before and that sparse is not right, but I can't remember... thanks, greg k-h