summaryrefslogtreecommitdiffstats
path: root/drivers/video/backlight/cr_bllcd.c
diff options
context:
space:
mode:
authorFilipe Manana <fdmanana@suse.com>2023-06-09 12:49:07 +0200
committerDavid Sterba <dsterba@suse.com>2023-06-19 13:59:39 +0200
commit7569141e8fa855b509e674456132b83bca5f087c (patch)
tree131723aa2437731c2d680aba7f81cffbe8fba870 /drivers/video/backlight/cr_bllcd.c
parentbtrfs: do not BUG_ON() on tree mod log failures at btrfs_del_ptr() (diff)
downloadlinux-7569141e8fa855b509e674456132b83bca5f087c.tar.xz
linux-7569141e8fa855b509e674456132b83bca5f087c.zip
btrfs: replace BUG_ON() at split_item() with proper error handling
There's no need to BUG_ON() at split_item() if the leaf does not have enough free space for the new item, we can just return -ENOSPC since the caller can deal with errors from split_item(). Also, as this is a very unlikely condition to happen, because the caller has invoked setup_leaf_for_split() before calling split_item(), surround the condition with a WARN_ON() which makes it easier to notice this unexpected condition and tags the if branch with 'unlikely' as well. I've actually once hit this BUG_ON() with some incorrect code changes I had, which was very inconvenient as it required rebooting the VM. Reviewed-by: Qu Wenruo <wqu@suse.com> Signed-off-by: Filipe Manana <fdmanana@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'drivers/video/backlight/cr_bllcd.c')
0 files changed, 0 insertions, 0 deletions