NetBSD-Bugs archive

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

Re: kern/44283



The following reply was made to PR kern/44283; it has been noted by GNATS.

From: Martin Husemann <martin%duskware.de@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: rherdware%yahoo.com@localhost
Subject: Re: kern/44283
Date: Thu, 7 Mar 2013 12:53:44 +0100

 --GvXjxJ+pjyke8COw
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 
 Could you try the attached (untested) patch?
 
 Martin
 
 --GvXjxJ+pjyke8COw
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: attachment; filename=patch
 
 Index: ses.c
 ===================================================================
 RCS file: /cvsroot/src/sys/dev/scsipi/ses.c,v
 retrieving revision 1.44
 diff -u -p -r1.44 ses.c
 --- ses.c      27 Oct 2012 17:18:38 -0000      1.44
 +++ ses.c      7 Mar 2013 11:52:37 -0000
 @@ -168,10 +168,11 @@ struct ses_softc {
  
  static int ses_match(device_t, cfdata_t, void *);
  static void ses_attach(device_t, device_t, void *);
 +static int ses_detach(device_t, int);
  static enctyp ses_device_type(struct scsipibus_attach_args *);
  
  CFATTACH_DECL_NEW(ses, sizeof (struct ses_softc),
 -    ses_match, ses_attach, NULL, NULL);
 +    ses_match, ses_attach, ses_detach, NULL);
  
  extern struct cfdriver ses_cd;
  
 @@ -276,7 +277,6 @@ ses_attach(device_t parent, device_t sel
        printf("\n%s: %s\n", device_xname(softc->sc_dev), tname);
  }
  
 -
  static enctyp
  ses_device_type(struct scsipibus_attach_args *sa)
  {
 @@ -811,6 +811,29 @@ ses_softc_init(ses_softc_t *ssc, int doi
  }
  
  static int
 +ses_detach(device_t self, int flags)
 +{
 +      struct ses_softc *ssc = device_private(self);
 +      struct sscfg *cc = ssc->ses_private;
 +
 +      if (ssc->ses_objmap) {
 +              SES_FREE(ssc->ses_objmap, (nobj * sizeof (encobj)));
 +      }
 +      if (cc != NULL) {
 +              if (cc->ses_typidx) {
 +                      SES_FREE(cc->ses_typidx,
 +                          (nobj * sizeof (struct typidx)));
 +              }
 +              if (cc->ses_eltmap) {
 +                      SES_FREE(cc->ses_eltmap, ntype);
 +              }
 +              SES_FREE(cc, sizeof (struct sscfg));
 +      }
 +
 +      return 0;
 +}
 +
 +static int
  ses_init_enc(ses_softc_t *ssc)
  {
        return (0);
 
 --GvXjxJ+pjyke8COw--
 


Home | Main Index | Thread Index | Old Index