public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: jonghwi.rha@samsung.com
Cc: "linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"hch@lst.de" <hch@lst.de>, 김정태 <jt1217.kim@samsung.com>,
	정혜연 <hyeon.chung@samsung.com>
Subject: Re: [Samsung] bsg-lib.c patch for double-free error fix.
Date: Mon, 12 Jan 2026 08:36:21 -0700	[thread overview]
Message-ID: <72e8bf7d-f4fd-42ec-890e-f4ff5aa3d314@kernel.dk> (raw)
In-Reply-To: <1591680112.4972876.1768210810254@v8mail-kr2-6.v8mail-kr2.knoxportal-kr-prod-blue.svc.cluster.local>

Please don't send patches as attachments, and particularly with html
emails as they will just get dropped from the list. And it makes it
impossible to reply to as well, as you then need to save and read the
patch separately and import it into an email...

> Change-Id: Iadb96f8736f8d9d9aae7b4a831c2a286ff59c520

What is this?

diff --git a/block/bsg-lib.c b/block/bsg-lib.c
index 9ceb5d0832f5..635b3b988f92 100644
--- a/block/bsg-lib.c
+++ b/block/bsg-lib.c
@@ -215,7 +215,7 @@ static int bsg_map_buffer(struct bsg_buffer *buf, struct request *req)
 
 	BUG_ON(!req->nr_phys_segments);
 
-	buf->sg_list = kmalloc(sz, GFP_KERNEL);
+	buf->sg_list = kzalloc(sz, GFP_KERNEL);
 	if (!buf->sg_list)
 		return -ENOMEM;
 	sg_init_table(buf->sg_list, req->nr_phys_segments);

How does this make a difference, when sg_init_table() explicitly sets it
all to 0?

-- 
Jens Axboe

       reply	other threads:[~2026-01-12 15:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20260112094010epcms2p518c5eb5408f90ceb7ef5739a0fbf7f65@epcms2p5>
     [not found] ` <1591680112.4972876.1768210810254@v8mail-kr2-6.v8mail-kr2.knoxportal-kr-prod-blue.svc.cluster.local>
2026-01-12 15:36   ` Jens Axboe [this message]
     [not found] <CGME20260130091020epcms2p2d85af8781639a17ab517208feb270dbd@epcms2p4>
2026-02-02 12:04 ` Re: [Samsung] bsg-lib.c patch for double-free error fix 라종휘
2026-02-05  3:46   ` Jens Axboe

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=72e8bf7d-f4fd-42ec-890e-f4ff5aa3d314@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=hch@lst.de \
    --cc=hyeon.chung@samsung.com \
    --cc=jonghwi.rha@samsung.com \
    --cc=jt1217.kim@samsung.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.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