selftests/ublk: add NULL check after calloc() - #162
Open
blktests-ci-block-trial[bot] wants to merge 2 commits into
Open
blktests-ci-block-trial[bot] wants to merge 2 commits into
blktests-ci-block-trial[bot] wants to merge 2 commits into
Conversation
Author
|
Upstream branch: 89a3129 |
Author
|
Upstream branch: 89a3129 |
blktests-ci-block-trial
Bot
force-pushed
the
series/777=>master
branch
from
September 2, 2026 12:22
2ea201e to
09ba7cd
Compare
blktests-ci-block-trial
Bot
force-pushed
the
master_base
branch
from
September 2, 2026 23:28
e8377ca to
1fff761
Compare
Author
|
Upstream branch: 940de59 |
blktests-ci-block-trial
Bot
force-pushed
the
series/777=>master
branch
from
September 2, 2026 23:41
09ba7cd to
2e38c28
Compare
blktests-ci-block-trial
Bot
force-pushed
the
master_base
branch
from
September 3, 2026 17:54
1fff761 to
3595ceb
Compare
Author
|
Upstream branch: 841e384 |
blktests-ci-block-trial
Bot
force-pushed
the
series/777=>master
branch
from
September 3, 2026 18:10
2e38c28 to
a631ebd
Compare
blktests-ci-block-trial
Bot
force-pushed
the
master_base
branch
from
September 3, 2026 22:51
3595ceb to
4061e04
Compare
Author
|
Upstream branch: a500db7 |
Three calloc() calls in the ublk selftests lack NULL return checks, leading to potential NULL pointer dereferences on allocation failure: 1. kublk.c ublk_ctrl_init(): the allocated `dev` is dereferenced immediately via `info = &dev->dev_info` without checking for NULL. 2. batch.c alloc_batch_commit_buf(): the allocated `t->commit` is dereferenced in the following for-loop without checking for NULL. 3. batch.c alloc_batch_fetch_buf(): the allocated `t->fetch` is dereferenced in the following for-loop without checking for NULL. Add NULL checks after each calloc(), returning NULL or -ENOMEM consistent with existing error handling in the same functions. Signed-off-by: longlong yan <yanlonglong@kylinos.cn> Reviewed-by: Ming Lei <tom.leiming@gmail.com>
blktests-ci-block-trial
Bot
force-pushed
the
series/777=>master
branch
from
September 3, 2026 23:05
a631ebd to
6a4a8b8
Compare
blktests-ci-block-trial
Bot
force-pushed
the
master_base
branch
7 times, most recently
from
September 16, 2026 21:01
73fe3ff to
15f6e70
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull request for series with
subject: selftests/ublk: add NULL check after calloc()
version: 1
url: http://redsun45:8000/project/linux-block/list/?series=777