mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Su Hui <suhui@nfschina.com>
To: Dan Carpenter <dan.carpenter@linaro.org>
Cc: airlied@redhat.com, kraxel@redhat.com,
	gurchetansingh@chromium.org, olvaffe@gmail.com, daniel@ffwll.ch,
	dri-devel@lists.freedesktop.org,
	virtualization@lists.linux-foundation.org,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] drm/virtio: remove some redundant code
Date: Wed, 12 Jul 2023 09:18:42 +0800	[thread overview]
Message-ID: <0561b89b-42a8-35bf-feaa-e5feb4ec3cd5@nfschina.com> (raw)
In-Reply-To: <7f67ed65-647a-44d7-a262-d3f1f48d90b9@kadam.mountain>

On 2023/7/11 19:13, Dan Carpenter wrote:
> On Tue, Jul 11, 2023 at 05:00:31PM +0800, Su Hui wrote:
>> virtio_gpu_get_vbuf always be successful,
>> so remove the error judgment.
>>
> No, just ignore the static checker false positive in this case.  The
> intent of the code is clear that if it did have an error it should
> return an error pointer.

Hi, Dan,

Function "virtio_gpu_get_vbuf" call "kmem_cache_zalloc (vgdev->vbufs, 
GFP_KERNEL | __GFP_NOFAIL)" to
allocate memory. Adding the " __GFP_NOFAIL”flag make sure it won't fail. 
And "virtio_gpu_get_vbuf" never
return an error code, so I think this is not a false positive.

Su Hui

>
> regards,
> dan carpenter
>

  reply	other threads:[~2023-07-12  1:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-11  9:00 Su Hui
2023-07-11 11:13 ` Dan Carpenter
2023-07-12  1:18   ` Su Hui [this message]
2023-07-12  6:36     ` Dan Carpenter
2023-07-12 10:15       ` Su Hui
     [not found] <6baf8384-af7a-06e1-6f91-8c4e8aa65197@web.de>
2023-07-12  1:26 ` Su Hui

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=0561b89b-42a8-35bf-feaa-e5feb4ec3cd5@nfschina.com \
    --to=suhui@nfschina.com \
    --cc=airlied@redhat.com \
    --cc=dan.carpenter@linaro.org \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gurchetansingh@chromium.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=kraxel@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=olvaffe@gmail.com \
    --cc=virtualization@lists.linux-foundation.org \
    /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

all inboxes | Powered by JetHome®