From: Mike Snitzer <snitzer@kernel.org>
To: Dan Carpenter <dan.carpenter@linaro.org>
Cc: msakai@redhat.com, dm-devel@lists.linux.dev
Subject: Re: [bug report] dm vdo: add flush support
Date: Sun, 11 Feb 2024 14:59:03 -0500 [thread overview]
Message-ID: <ZcknB66hlxVFOBi4@redhat.com> (raw)
In-Reply-To: <c91e8c15-d418-419c-aebe-078bd8f12687@moroto.mountain>
On Fri, Feb 09 2024 at 3:48P -0500,
Dan Carpenter <dan.carpenter@linaro.org> wrote:
> Hello Matthew Sakai,
>
> The patch 7d7084389ab3: "dm vdo: add flush support" from Nov 16, 2023
> (linux-next), leads to the following Smatch static checker warning:
>
> drivers/md/dm-vdo/flush.c:114 allocate_flush()
> error: uninitialized symbol 'flush'.
>
> drivers/md/dm-vdo/flush.c
> 101 static void *allocate_flush(gfp_t gfp_mask, void *pool_data)
> 102 {
> 103 struct vdo_flush *flush;
> 104
> 105 if ((gfp_mask & GFP_NOWAIT) == GFP_NOWAIT) {
> 106 flush = uds_allocate_memory_nowait(sizeof(struct vdo_flush), __func__);
> 107 } else {
> 108 int result = uds_allocate(1, struct vdo_flush, __func__, &flush);
> 109
> 110 if (result != VDO_SUCCESS)
> 111 uds_log_error_strerror(result, "failed to allocate spare flush");
>
> In real life, uds_allocate_memory() isn't going to fail here, but
> if it did then "flush" isn't initialized...
>
> 112 }
> 113
> --> 114 if (flush != NULL) {
> 115 struct flusher *flusher = pool_data;
> 116
> 117 vdo_initialize_completion(&flush->completion, flusher->vdo,
> 118 VDO_FLUSH_COMPLETION);
> 119 }
> 120
> 121 return flush;
> 122 }
>
> regards,
> dan carpenter
>
I've fixed this and added your Reported-by
Thanks,
Mike
prev parent reply other threads:[~2024-02-11 19:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-09 8:48 [bug report] dm vdo: add flush support Dan Carpenter
2024-02-11 19:59 ` Mike Snitzer [this message]
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=ZcknB66hlxVFOBi4@redhat.com \
--to=snitzer@kernel.org \
--cc=dan.carpenter@linaro.org \
--cc=dm-devel@lists.linux.dev \
--cc=msakai@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.