linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wang Cheng <wanngchenng@gmail.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: paskripkin@gmail.com, linux-staging@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/2] staging: rtl8712: fix uninit-value in usb_read8() and friends
Date: Fri, 6 May 2022 19:22:09 +0800	[thread overview]
Message-ID: <20220506112209.hslb67cuinntusuc@ppc.localdomain> (raw)
In-Reply-To: <20220506071023.GB4031@kadam>

On 22/05/06 10:10AM, Dan Carpenter wrote:
> Setting "data = 0" will silence the KMSAN warnings but it doesn't fix
> the bug which is that r8712_usbctrl_vendorreq() treats partial reads
> as success.
> 
> The usb_control_msg() returns negatives on total failure and it returns
> small positives on partial failure.  So take the code that I gave you
> before and put that into r8712_usbctrl_vendorreq().  That's patch 1.
> These patches become 2 and 3.

Ah, you mentioned in previous review "But then another problem is that
"status" can be less than "len"." I missed it then.

- w

> 
>         status = usb_control_msg();
>         if (status < 0)
>                 goto free;
>         if (status != len) {
>                 status = -EREMOTEIO;
>                 goto free;
>         }
>         if (requesttype == 0x01)
>                 memcpy(pdata, pIo_buf, status);
> 
> regards,
> dan carpenter
> 

  reply	other threads:[~2022-05-06 11:22 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-06  3:13 [PATCH v2 0/2] staging: rtl8712: fix uninit-value 'data' and 'mac' Wang Cheng
2022-05-06  3:15 ` [PATCH v2 1/2] staging: rtl8712: fix uninit-value in usb_read8() and friends Wang Cheng
2022-05-06  7:10   ` Dan Carpenter
2022-05-06 11:22     ` Wang Cheng [this message]
2022-05-06  7:23   ` Pavel Skripkin
2022-05-06  7:57     ` Dan Carpenter
2022-05-06  3:16 ` [PATCH v2 2/2] staging: rtl8712: fix uninit-value in r871xu_drv_init() Wang Cheng
2022-05-06  7:41   ` Pavel Skripkin
2022-05-06 11:33     ` Wang Cheng
2022-05-06 11:56       ` Wang Cheng
2022-05-06 12:02       ` Pavel Skripkin
2022-05-09  4:03         ` Wang Cheng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220506112209.hslb67cuinntusuc@ppc.localdomain \
    --to=wanngchenng@gmail.com \
    --cc=dan.carpenter@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=paskripkin@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).