linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] target: need_to_release is always false, remove redundant check and kfree
@ 2016-05-05 23:16 Colin King
  2016-05-08  8:12 ` Christoph Hellwig
  0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2016-05-05 23:16 UTC (permalink / raw)
  To: Nicholas A . Bellinger, linux-scsi, target-devel; +Cc: linux-kernel

From: Colin Ian King <colin.king@canonical.com>

The removal the #ifdef'd code on CONFIG_ARCH_HAS_SG_CHAIN in
commit 02c4de53add1b79 ("target/rd: always chain S/G list")
removed the setting of need_to_release to true, so we are now left
with need_to_release always being false and hence the conditional
kfree is never reached.  Clean up the dead code by removing need_to_release
and the conditional kfree.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/target/target_core_rd.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/target/target_core_rd.c b/drivers/target/target_core_rd.c
index 47a833f..24b36fd 100644
--- a/drivers/target/target_core_rd.c
+++ b/drivers/target/target_core_rd.c
@@ -403,7 +403,6 @@ static sense_reason_t rd_do_prot_rw(struct se_cmd *cmd, bool is_read)
 	struct se_device *se_dev = cmd->se_dev;
 	struct rd_dev *dev = RD_DEV(se_dev);
 	struct rd_dev_sg_table *prot_table;
-	bool need_to_release = false;
 	struct scatterlist *prot_sg;
 	u32 sectors = cmd->data_length / se_dev->dev_attrib.block_size;
 	u32 prot_offset, prot_page;
@@ -432,9 +431,6 @@ static sense_reason_t rd_do_prot_rw(struct se_cmd *cmd, bool is_read)
 	if (!rc)
 		sbc_dif_copy_prot(cmd, sectors, is_read, prot_sg, prot_offset);
 
-	if (need_to_release)
-		kfree(prot_sg);
-
 	return rc;
 }
 
-- 
2.8.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] target: need_to_release is always false, remove redundant check and kfree
  2016-05-05 23:16 [PATCH] target: need_to_release is always false, remove redundant check and kfree Colin King
@ 2016-05-08  8:12 ` Christoph Hellwig
  0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2016-05-08  8:12 UTC (permalink / raw)
  To: Colin King; +Cc: Nicholas A . Bellinger, linux-scsi, target-devel, linux-kernel

Looks fine,

Reviewed-by: Christoph Hellwig <hch@lst.de>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-05-08  8:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-05 23:16 [PATCH] target: need_to_release is always false, remove redundant check and kfree Colin King
2016-05-08  8:12 ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).