Re: [PATCH 1/5] target: remove tf_subsystem pointers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2015-05-07 at 12:07 +0300, Sagi Grimberg wrote:
> On 5/3/2015 9:50 AM, Christoph Hellwig wrote:
> > There is just one configfs subsystem in the target code, so we might as
> > well add two helpers to reference / unreference it from the core code
> > instead of passing pointers to it around.
> >
> > Signed-off-by: Christoph Hellwig <hch@xxxxxx>
> > ---
> >   drivers/scsi/qla2xxx/tcm_qla2xxx.c    |  6 ++----
> >   drivers/target/target_core_configfs.c | 30 ++++++++++++++----------------
> >   drivers/target/target_core_internal.h |  3 ---
> >   drivers/target/target_core_pr.c       | 32 +++++++-------------------------
> >   drivers/target/target_core_xcopy.c    | 15 ++++++---------
> >   drivers/vhost/scsi.c                  |  6 ++----
> >   include/target/target_core_configfs.h |  2 --
> >   include/target/target_core_fabric.h   |  4 +++-
> >   8 files changed, 34 insertions(+), 64 deletions(-)
> >

<SNIP>

> >   static void __exit target_core_exit_configfs(void)
> >   {
> > -	struct configfs_subsystem *subsys;
> >   	struct config_group *hba_cg, *alua_cg, *lu_gp_cg;
> >   	struct config_item *item;
> >   	int i;
> >
> > -	subsys = target_core_subsystem[0];
> > -
> >   	lu_gp_cg = &alua_lu_gps_group;
> >   	for (i = 0; lu_gp_cg->default_groups[i]; i++) {
> >   		item = &lu_gp_cg->default_groups[i]->cg_item;
> > @@ -3015,8 +3013,8 @@ static void __exit target_core_exit_configfs(void)
> >   	 * We expect subsys->su_group.default_groups to be released
> >   	 * by configfs subsystem provider logic..
> >   	 */
> > -	configfs_unregister_subsystem(subsys);
> > -	kfree(subsys->su_group.default_groups);
> > +	configfs_unregister_subsystem(&target_core_fabrics);
> > +	kfree(&target_core_fabrics.su_group.default_groups);
> 
> There is an extra & here that causes a crash on a bogus free.
> 
> Nic, can you fold this in?
> 
> diff --git a/drivers/target/target_core_configfs.c 
> b/drivers/target/target_core_configfs.c
> index a6c809c..2768221 100644
> --- a/drivers/target/target_core_configfs.c
> +++ b/drivers/target/target_core_configfs.c
> @@ -2997,7 +2997,7 @@ static void __exit target_core_exit_configfs(void)
>           * by configfs subsystem provider logic..
>           */
>          configfs_unregister_subsystem(&target_core_fabrics);
> -       kfree(&target_core_fabrics.su_group.default_groups);
> +       kfree(target_core_fabrics.su_group.default_groups);
> 
>          core_alua_free_lu_gp(default_lu_gp);
>          default_lu_gp = NULL;

Applied + squashed into HCH's original commit.

Thanks Sagi!

--nab

--
To unsubscribe from this list: send the line "unsubscribe target-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux SCSI]     [Kernel Newbies]     [Linux SCSI Target Infrastructure]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Device Mapper]

  Powered by Linux